diff options
Diffstat (limited to 'kvision-modules/kvision-remote/build.gradle')
-rw-r--r-- | kvision-modules/kvision-remote/build.gradle | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/kvision-modules/kvision-remote/build.gradle b/kvision-modules/kvision-remote/build.gradle index b99fb199..277cce18 100644 --- a/kvision-modules/kvision-remote/build.gradle +++ b/kvision-modules/kvision-remote/build.gradle @@ -1,5 +1,37 @@ -apply from: "../shared.gradle" +apply plugin: 'kotlin-platform-js' +apply plugin: 'kotlinx-serialization' + +task cleanLibs(type: Delete) { + delete 'build/js', 'build/libs' +} + +if (project.gradle.startParameter.taskNames.contains("jar")) { + compileKotlin2Js.dependsOn 'cleanLibs' +} + +jar { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} + +compileKotlin2Js { + kotlinOptions.metaInfo = true + kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js" + kotlinOptions.sourceMap = !production + kotlinOptions.moduleKind = 'umd' +} + +compileTestKotlin2Js { + kotlinOptions.metaInfo = true + kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js" + kotlinOptions.sourceMap = !production + kotlinOptions.moduleKind = 'umd' +} dependencies { expectedBy project(":kvision-modules:kvision-common-remote") + expectedBy project(":kvision-modules:kvision-common-types") + compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion" + compile "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutinesVersion" + compile "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:$serializationVersion" + compile "pl.treksoft:jquery-kotlin:$jqueryKotlinVersion" } |