aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote/build.gradle
blob: e5cac713852e2e9bcbe8afcf3ab1e7b309d4fa9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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")
    expectedBy project(":kvision-modules:kvision-common-annotations")
    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"
}