2019-03-08 11:55:01 +03:00
|
|
|
import org.jetbrains.kotlin.gradle.frontend.KotlinFrontendExtension
|
|
|
|
import org.jetbrains.kotlin.gradle.frontend.npm.NpmExtension
|
|
|
|
import org.jetbrains.kotlin.gradle.frontend.webpack.WebPackExtension
|
2019-05-28 17:59:56 +03:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
2019-03-08 11:55:01 +03:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("kotlin2js")
|
|
|
|
id("kotlin-dce-js")
|
|
|
|
id("org.jetbrains.kotlin.frontend")
|
|
|
|
}
|
|
|
|
|
2019-03-27 22:14:42 +03:00
|
|
|
val kotlinVersion: String by rootProject.extra
|
2019-03-08 11:55:01 +03:00
|
|
|
|
|
|
|
dependencies {
|
2019-05-28 17:59:56 +03:00
|
|
|
implementation(project(":dataforge-vis-spatial"))
|
2019-07-05 19:08:20 +03:00
|
|
|
implementation("info.laht.threekt:threejs-wrapper:0.106-npm-2")
|
2019-06-25 10:01:21 +03:00
|
|
|
testCompile(kotlin("test-js"))
|
2019-03-08 11:55:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
configure<KotlinFrontendExtension> {
|
|
|
|
downloadNodeJsVersion = "latest"
|
|
|
|
|
|
|
|
configure<NpmExtension> {
|
2019-07-05 19:08:20 +03:00
|
|
|
dependency("three","0.106.2")
|
2019-07-03 16:02:26 +03:00
|
|
|
dependency("@hi-level/three-csg")
|
2019-03-08 11:55:01 +03:00
|
|
|
dependency("style-loader")
|
2019-06-30 20:23:38 +03:00
|
|
|
dependency("element-resize-event")
|
2019-03-08 11:55:01 +03:00
|
|
|
devDependency("karma")
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceMaps = true
|
|
|
|
|
2019-06-25 10:01:21 +03:00
|
|
|
bundle<WebPackExtension>("webpack") {
|
2019-03-08 11:55:01 +03:00
|
|
|
this as WebPackExtension
|
|
|
|
bundleName = "main"
|
|
|
|
contentPath = file("src/main/web")
|
|
|
|
sourceMapEnabled = true
|
|
|
|
//mode = "production"
|
|
|
|
mode = "development"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-28 17:59:56 +03:00
|
|
|
tasks {
|
|
|
|
"compileKotlin2Js"(Kotlin2JsCompile::class) {
|
|
|
|
kotlinOptions {
|
2019-03-08 11:55:01 +03:00
|
|
|
metaInfo = true
|
|
|
|
outputFile = "${project.buildDir.path}/js/${project.name}.js"
|
|
|
|
sourceMap = true
|
2019-05-28 17:59:56 +03:00
|
|
|
moduleKind = "commonjs"
|
2019-03-08 11:55:01 +03:00
|
|
|
main = "call"
|
2019-03-17 16:02:59 +03:00
|
|
|
kotlinOptions.sourceMapEmbedSources = "always"
|
2019-03-08 11:55:01 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-28 17:59:56 +03:00
|
|
|
"compileTestKotlin2Js"(Kotlin2JsCompile::class) {
|
|
|
|
kotlinOptions {
|
2019-03-08 11:55:01 +03:00
|
|
|
metaInfo = true
|
|
|
|
outputFile = "${project.buildDir.path}/js/${project.name}-test.js"
|
|
|
|
sourceMap = true
|
2019-05-28 17:59:56 +03:00
|
|
|
moduleKind = "commonjs"
|
2019-03-17 16:02:59 +03:00
|
|
|
kotlinOptions.sourceMapEmbedSources = "always"
|
2019-03-08 11:55:01 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|