1
1
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
2
+ import static KotlinVersion.isKotlinVersionAtLeast
2
3
3
4
/*
4
5
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
@@ -18,7 +19,14 @@ if (rootProject.ext.native_targets_enabled) {
18
19
}
19
20
20
21
apply from : rootProject. file(" gradle/compile-js-multiplatform.gradle" )
21
- apply from : rootProject. file(" gradle/compile-wasm-multiplatform.gradle" )
22
+
23
+ // TODO: Wasm target names have been changed since 1.9.20, remove this after migration to 1.9.20
24
+ def isNewWasmTargetEnabled = isKotlinVersionAtLeast(ext. kotlin_version, 1 , 9 , 20 )
25
+ if (isNewWasmTargetEnabled) {
26
+ apply from : rootProject. file(" gradle/compile-wasm-multiplatform.gradle" )
27
+ } else {
28
+ apply from : rootProject. file(" gradle/compile-wasm-multiplatform19.gradle" )
29
+ }
22
30
23
31
apply from : rootProject. file(' gradle/dokka.gradle.kts' )
24
32
apply from : rootProject. file(' gradle/publish.gradle' )
@@ -268,12 +276,20 @@ jvmTest {
268
276
// Setup manifest for kotlinx-coroutines-core-jvm.jar
269
277
jvmJar { setupManifest(it) }
270
278
271
- wasmNodeTest {
272
- filter. with {
273
- excludeTest(" ChannelsTest" , " testIterableAsReceiveChannel" )
274
- excludeTest(" ChannelsTest" , " testEmptyList" )
275
- excludeTest(" ChannelsTest" , " testToList" )
276
- excludeTest(" ChannelBuildersFlowTest" , " testConsumeAsFlowProduceBuffered" )
279
+ void addIngoreTestsForWasm (org.gradle.api.tasks.testing.TestFilter filter ) {
280
+ filter. excludeTest(" ChannelsTest" , " testIterableAsReceiveChannel" )
281
+ filter. excludeTest(" ChannelsTest" , " testEmptyList" )
282
+ filter. excludeTest(" ChannelsTest" , " testToList" )
283
+ filter. excludeTest(" ChannelBuildersFlowTest" , " testConsumeAsFlowProduceBuffered" )
284
+ }
285
+
286
+ if (isNewWasmTargetEnabled) {
287
+ wasmJsNodeTest {
288
+ addIngoreTestsForWasm(filter)
289
+ }
290
+ } else {
291
+ wasmNodeTest {
292
+ addIngoreTestsForWasm(filter)
277
293
}
278
294
}
279
295
0 commit comments