visionforge/dataforge-vis-spatial-js/build.gradle.kts

64 lines
1.8 KiB
Plaintext
Raw Normal View History

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")
}
val kotlinVersion: String by rootProject.extra
2019-03-08 11:55:01 +03:00
dependencies {
2019-07-08 22:25:08 +03:00
api(project(":dataforge-vis-spatial"))
api("info.laht.threekt:threejs-wrapper:0.106-npm-2")
testCompile(kotlin("test-js"))
2019-03-08 11:55:01 +03:00
}
configure<KotlinFrontendExtension> {
downloadNodeJsVersion = "latest"
configure<NpmExtension> {
dependency("three","0.106.2")
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
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
}
}
}