|
6 | 6 | import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension |
7 | 7 | import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet |
8 | 8 | import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension |
| 9 | +import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask |
9 | 10 | import kotlin.jvm.optionals.getOrNull |
10 | 11 |
|
11 | 12 | plugins { |
@@ -38,7 +39,7 @@ kotlin { |
38 | 39 | } |
39 | 40 |
|
40 | 41 | @OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class) |
41 | | - wasm { |
| 42 | + wasmJs { |
42 | 43 | nodejs() |
43 | 44 | // Disabled because we can't exclude some tests: https://youtrack.jetbrains.com/issue/KT-58291 |
44 | 45 | // browser() |
@@ -89,6 +90,12 @@ kotlin { |
89 | 90 | createSourceSet("linuxTest", parent = unixTest, children = linuxTargets()) |
90 | 91 | createSourceSet("androidMain", parent = unixMain, children = androidTargets()) |
91 | 92 | createSourceSet("androidTest", parent = unixTest, children = androidTargets()) |
| 93 | + getByName("wasmJsMain") { |
| 94 | + kotlin.srcDir(File(File(projectDir, "wasm"), "src")) |
| 95 | + } |
| 96 | + getByName("wasmJsTest") { |
| 97 | + kotlin.srcDir(File(File(projectDir, "wasm"), "test")) |
| 98 | + } |
92 | 99 | } |
93 | 100 | } |
94 | 101 |
|
@@ -192,5 +199,10 @@ fun androidTargets() = listOf( |
192 | 199 | ) |
193 | 200 |
|
194 | 201 | rootProject.the<NodeJsRootExtension>().apply { |
195 | | - nodeVersion = "20.4.0" |
| 202 | + nodeVersion = "21.0.0-v8-canary202310177990572111" |
| 203 | + nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary" |
| 204 | +} |
| 205 | + |
| 206 | +rootProject.tasks.withType<KotlinNpmInstallTask>().configureEach { |
| 207 | + args.add("--ignore-engines") |
196 | 208 | } |
0 commit comments