@@ -6,12 +6,16 @@ apply from: rootProject.file('gradle/node-js.gradle')
6
6
7
7
kotlin {
8
8
targets {
9
- fromPreset(presets. js, ' js' )
9
+ fromPreset(presets. js, ' js' ) {
10
+ browser()
11
+ nodejs()
12
+ }
10
13
}
11
14
12
15
sourceSets {
13
16
jsMain. dependencies {
14
17
api " org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version "
18
+ api " org.jetbrains.kotlinx:atomicfu-js:$atomicfu_version "
15
19
}
16
20
17
21
jsTest. dependencies {
@@ -27,26 +31,30 @@ compileKotlinJs {
27
31
kotlinOptions. metaInfo = true
28
32
kotlinOptions. sourceMap = true
29
33
kotlinOptions. moduleKind = ' umd'
30
-
31
- kotlinOptions {
32
- // drop -js suffix from outputFile
33
- def baseName = project. name - " -js"
34
- outputFile = new File (outputFile. parent, baseName + " .js" )
35
- }
36
34
}
37
35
38
36
compileTestKotlinJs {
39
37
kotlinOptions. metaInfo = true
40
38
kotlinOptions. sourceMap = true
41
39
kotlinOptions. moduleKind = ' umd'
40
+ kotlinOptions. freeCompilerArgs + = " -XXLanguage:-NewInference"
41
+ }
42
+
43
+ if (project. tasks. findByName(' compileKotlinJsIr' )) {
44
+ compileKotlinJsIr {
45
+ kotlinOptions. freeCompilerArgs + = " -XXLanguage:-NewInference"
46
+ }
42
47
}
43
48
44
49
task populateNodeModules (type : Copy , dependsOn : compileTestKotlinJs) {
45
50
// we must copy output that is transformed by atomicfu
46
51
from(kotlin. targets. js. compilations. main. output. allOutputs)
47
52
into " $node . nodeModulesDir /node_modules"
48
53
49
- def configuration = configurations. jsTestRuntimeClasspath
54
+ def configuration = configurations. hasProperty(" legacyjsTestRuntimeClasspath" )
55
+ ? configurations. legacyjsTestRuntimeClasspath
56
+ : configurations. jsTestRuntimeClasspath
57
+
50
58
from(files {
51
59
configuration. collect { File file ->
52
60
file. name. endsWith(" .jar" ) ?
0 commit comments