5
5
apply plugin : ' kotlin-dce-js'
6
6
apply from : rootProject. file(' gradle/node-js.gradle' )
7
7
8
- // Workaround resolving new Gradle metadata with kotlin2js
9
- // TODO: Remove once KT-37188 is fixed
10
- try {
11
- def jsCompilerType = Class . forName(" org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute" )
12
- def jsCompilerAttr = Attribute . of(" org.jetbrains.kotlin.js.compiler" , jsCompilerType)
13
- project. dependencies. attributesSchema. attribute(jsCompilerAttr)
14
- configurations {
15
- matching {
16
- it. name. endsWith(" Classpath" )
17
- }. forEach {
18
- it. attributes. attribute(jsCompilerAttr, jsCompilerType. legacy)
19
- }
20
- }
21
- } catch (java.lang.ClassNotFoundException e) {
22
- // org.jetbrains.kotlin.gradle.targets.js.JsCompilerType is missing in 1.3.x
23
- // But 1.3.x doesn't generate Gradle metadata, so this workaround is not needed
24
- }
25
-
26
8
dependencies {
27
9
compile " org.jetbrains.kotlinx:kotlinx-html-js:$html_version "
28
10
}
29
11
30
- compileKotlin2Js {
12
+ compileKotlinJs {
31
13
kotlinOptions {
32
14
main = " call"
33
15
}
34
16
}
35
17
36
- task bundle (type : NpmTask , dependsOn : [npmInstall, runDceKotlinJs ]) {
18
+ task bundle (type : NpmTask , dependsOn : [npmInstall, build ]) {
37
19
inputs. files(fileTree(" $buildDir /kotlin-js-min/main" ))
20
+ inputs. files(fileTree(" $buildDir /kotlin-js-min/legacy/main" ))
38
21
inputs. files(fileTree(file(" src/main/web" )))
39
22
inputs. file(" npm/webpack.config.js" )
40
23
outputs. dir(" $buildDir /dist" )
@@ -44,11 +27,3 @@ task bundle(type: NpmTask, dependsOn: [npmInstall, runDceKotlinJs]) {
44
27
task start (type : NpmTask , dependsOn : bundle) {
45
28
args = [" run" , " start" ]
46
29
}
47
-
48
- // we have not tests but kotlin-dce-js still tries to work with them and crashed.
49
- // todo: Remove when KT-22028 is fixed
50
- afterEvaluate {
51
- if (tasks. findByName(' unpackDependenciesTestKotlinJs' )) {
52
- tasks. unpackDependenciesTestKotlinJs. enabled = false
53
- }
54
- }
0 commit comments