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

63 lines
1.7 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")
}
2019-04-02 20:24:31 +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-03-17 16:02:59 +03:00
implementation("info.laht.threekt:threejs-wrapper:0.88-npm-2")
testCompile(kotlin("test-js"))
2019-03-08 11:55:01 +03:00
}
configure<KotlinFrontendExtension> {
downloadNodeJsVersion = "latest"
configure<NpmExtension> {
2019-03-09 11:39:01 +03:00
dependency("three-full")
2019-03-08 11:55:01 +03:00
dependency("style-loader")
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
}
}
}