aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-electron/build.gradle
blob: 8716dd654afdae77504a7af443a9dcd1c0f44c9a (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
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 {
    compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion"
    compile "me.kgustave:node-kt:$nodeKtVersion"
}