@@ -17,18 +17,35 @@ buildConfig {
17
17
}
18
18
}
19
19
20
+ /* Multiple variants are offered of the dependencies kotlin-dom-api-compat and kotlin-stdlib-js. Usually, Gradle picks
21
+ * them automatically based on what kind of build it is, i.e. it would look for a platform JVM variant for this JVM build.
22
+ * Naturally, there is no JVM version for JS libraries. We need to fix the variant attributes manually so the right variant
23
+ * will be picked for runtime use in the JS compile tests. */
20
24
configurations. all {
21
25
resolutionStrategy. dependencySubstitution {
22
26
substitute(module(" org.jetbrains.kotlin:kotlin-dom-api-compat" ))
23
27
.using variant(module(" org.jetbrains.kotlin:kotlin-dom-api-compat:$embedded_kotlin_version " )) {
24
28
attributes {
25
- attribute(KotlinPlatformType . attribute , KotlinPlatformType . js)
29
+ attribute(Attribute . of( " org.jetbrains.kotlin.platform.type " , KotlinPlatformType . class) , KotlinPlatformType . js)
26
30
attribute(Usage . USAGE_ATTRIBUTE , project. objects. named(Usage , " kotlin-runtime" ))
27
31
}
28
32
}
29
33
}
30
34
}
31
35
36
+ configurations. all {
37
+ resolutionStrategy. dependencySubstitution {
38
+ substitute(module(" org.jetbrains.kotlin:kotlin-stdlib-js" ))
39
+ .using variant(module(" org.jetbrains.kotlin:kotlin-stdlib-js:$embedded_kotlin_version " )) {
40
+ attributes {
41
+ attribute(Attribute . of(" org.jetbrains.kotlin.platform.type" , KotlinPlatformType . class), KotlinPlatformType . js)
42
+ attribute(Usage . USAGE_ATTRIBUTE , project. objects. named(Usage , " kotlin-runtime" ))
43
+ attribute(Attribute . of(" org.jetbrains.kotlin.js.compiler" , String ), " ir" )
44
+ }
45
+ }
46
+ }
47
+ }
48
+
32
49
dependencies {
33
50
compileOnly ' com.google.auto.service:auto-service:1.1.1'
34
51
kapt " com.google.auto.service:auto-service:1.1.1"
@@ -44,7 +61,7 @@ dependencies {
44
61
// running compiler plugins passed via the pluginClasspath CLI option works
45
62
testRuntimeOnly " org.jetbrains.kotlin:kotlin-scripting-compiler:$embedded_kotlin_version "
46
63
47
- // Include Kotlin/JS standard library in test classpath for auto loading
64
+ // Include Kotlin/JS standard library in test classpath for auto loading
48
65
testRuntimeOnly " org.jetbrains.kotlin:kotlin-stdlib-js"
49
66
testRuntimeOnly " org.jetbrains.kotlin:kotlin-dom-api-compat"
50
67
0 commit comments