aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote/build.gradle
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-02-18 17:10:10 +0100
committerRobert Jaros <rjaros@finn.pl>2019-02-18 17:10:10 +0100
commit667b3f983a3a77865e4fb89c0cf531ce982904ac (patch)
treea65572ca6ee9ee728d8fbe8b50bc18d866316cfb /kvision-modules/kvision-remote/build.gradle
parent29f0867506334d0f7387f654e7d84b6840a1ad86 (diff)
downloadkvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.tar.gz
kvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.tar.bz2
kvision-667b3f983a3a77865e4fb89c0cf531ce982904ac.zip
Make kvision-remote module independent of kvision itself.
Change the default JSON serialization format of Date objects (plain long value).
Diffstat (limited to 'kvision-modules/kvision-remote/build.gradle')
-rw-r--r--kvision-modules/kvision-remote/build.gradle34
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"
}