blob: af54ea96d9ea3f6a573bee540d6903918a524410 [file] [log] [blame]
Roman Elizarovdecbc832017-12-26 23:05:20 +03001/*
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03002 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarovdecbc832017-12-26 23:05:20 +03003 */
4
5apply plugin: 'kotlin-dce-js'
Roman Elizarov94fb2a32018-03-05 17:32:59 +03006apply from: rootProject.file('gradle/node-js.gradle')
Roman Elizarovdecbc832017-12-26 23:05:20 +03007
8dependencies {
9 compile "org.jetbrains.kotlinx:kotlinx-html-js:$html_version"
10}
11
12compileKotlin2Js {
13 kotlinOptions {
14 main = "call"
15 }
16}
17
Roman Elizarovdecbc832017-12-26 23:05:20 +030018task bundle(type: NpmTask, dependsOn: [npmInstall, runDceKotlinJs]) {
Roman Elizarov9fcb24f2018-03-06 11:25:09 +030019 inputs.files(fileTree("$buildDir/kotlin-js-min/main"))
20 inputs.files(fileTree(file("src/main/web")))
21 inputs.file("webpack.config.js")
22 outputs.dir("$buildDir/dist")
Roman Elizarovdecbc832017-12-26 23:05:20 +030023 args = ["run", "bundle"]
24}
25
26task start(type: NpmTask, dependsOn: bundle) {
27 args = ["run", "start"]
Roman Elizarov2b62f6d2017-12-27 17:43:08 +030028}
Roman Elizarovf0a55f32018-01-11 11:03:34 +030029
30// we have not tests but kotlin-dce-js still tries to work with them and crashed.
31// todo: Remove when KT-22028 is fixed
32afterEvaluate {
Roman Elizarov8fca5d32018-01-17 10:21:43 +030033 if (tasks.findByName('unpackDependenciesTestKotlinJs')) {
34 tasks.unpackDependenciesTestKotlinJs.enabled = false
35 }
Roman Elizarovf0a55f32018-01-11 11:03:34 +030036}