diff --git a/build.gradle.kts b/build.gradle.kts index 9c60a63..7a38dc4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension +import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile import org.jetbrains.kotlin.konan.target.HostManager @@ -9,6 +11,8 @@ plugins { id("signing") } +val nodeVersion = properties["nodeVersion"] as String + repositories { mavenCentral() } @@ -171,8 +175,16 @@ tasks.withType().configureEach { compilerOptions.freeCompilerArgs.add("-opt-in=kotlinx.cinterop.ExperimentalForeignApi") } -plugins.withType { - the().nodeVersion = "20.11.1" +rootProject.plugins.withType(NodeJsRootPlugin::class.java) { + rootProject.the().download = true + rootProject.the().nodeVersion = nodeVersion + if (nodeVersion.contains("canary")) { + rootProject.the().nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary" + } +} + +tasks.withType(org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask::class.java).configureEach { + args.add("--ignore-engines") } val ktlintConfig by configurations.creating diff --git a/gradle.properties b/gradle.properties index b63d4fd..c0c57ba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ +nodeVersion=21.0.0-v8-canary20231024d0ddc81258 + org.gradle.caching=true org.gradle.parallel=true