[JS] Define Node.js version in one place and use a single version everywhere

Consequently, it fixes the inability to run some JS related tests on Apple devices with ARM.
This commit is contained in:
Zalim Bashorov
2022-04-21 20:02:10 +02:00
parent 64bcd8c91e
commit 90c867ae1d
7 changed files with 11 additions and 8 deletions
+2
View File
@@ -261,6 +261,8 @@ fun Project.kotlinxCollectionsImmutable() =
val Project.kotlinNativeVersion: String get() = property("versions.kotlin-native") as String val Project.kotlinNativeVersion: String get() = property("versions.kotlin-native") as String
val Project.nodejsVersion: String get() = property("versions.nodejs") as String
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex()) fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
private val wildcardsRe = """[^*?]+|(\*)|(\?)""".toRegex() private val wildcardsRe = """[^*?]+|(\*)|(\?)""".toRegex()
+2 -1
View File
@@ -47,4 +47,5 @@ versions.ktor-network=1.0.1
versions.native-platform=0.14 versions.native-platform=0.14
versions.protobuf=2.6.1 versions.protobuf=2.6.1
versions.r8=2.2.64 versions.r8=2.2.64
versions.robolectric=4.0 versions.robolectric=4.0
versions.nodejs=16.13.0
+1 -1
View File
@@ -14,7 +14,7 @@ plugins {
node { node {
download.set(true) download.set(true)
version.set("10.16.2") version.set(nodejsVersion)
nodeProjectDir.set(buildDir) nodeProjectDir.set(buildDir)
} }
@@ -12,7 +12,7 @@ plugins {
description = "Kotlin-test integration tests for JS IR" description = "Kotlin-test integration tests for JS IR"
node { node {
version.set("16.13.0") version.set(nodejsVersion)
download.set(true) download.set(true)
} }
@@ -126,4 +126,4 @@ dependencies {
tasks.named("compileTestKotlinJs") { tasks.named("compileTestKotlinJs") {
dependsOn(jsMainSources) dependsOn(jsMainSources)
dependsOn(jsSources) dependsOn(jsSources)
} }
+2 -2
View File
@@ -51,7 +51,7 @@ tasks.register("populateNodeModules", Copy) {
} }
node { node {
version = '12.18.0' version = DependenciesKt.getNodejsVersion(project)
download = true download = true
} }
@@ -90,4 +90,4 @@ tasks.check {
['Jest', 'Jasmine', 'Mocha', 'Qunit', 'Tape'].each { ['Jest', 'Jasmine', 'Mocha', 'Qunit', 'Tape'].each {
dependsOn createFrameworkTest(it) dependsOn createFrameworkTest(it)
} }
} }
+1 -1
View File
@@ -336,7 +336,7 @@ artifacts {
node { node {
download = true download = true
version = '12.18.0' version = DependenciesKt.getNodejsVersion(project)
nodeProjectDir = buildDir nodeProjectDir = buildDir
} }
@@ -13,7 +13,7 @@ val default = configurations.getByName(Dependency.DEFAULT_CONFIGURATION)
default.extendsFrom(configurations.publishedRuntime.get()) default.extendsFrom(configurations.publishedRuntime.get())
node { node {
version.set("16.2.0") version.set(nodejsVersion)
download.set(true) download.set(true)
nodeProjectDir.set(projectDir) nodeProjectDir.set(projectDir)
} }