[stdlib-mpp] Workaround legacy JS stdlib test run not using freshly-built kotlin.js
Move kotlin.js and kotlin-test-js-v1 output closer to kotlin-stdlib-js-v1-test to avoid picking (or missing) kotlin.js from bootstrap higher in hierarchy #KT-56106
This commit is contained in:
committed by
Space Team
parent
d7d14e7e9e
commit
3090181cc5
@@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl
|
||||
import org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain
|
||||
import plugins.configureDefaultPublishing
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
|
||||
|
||||
plugins {
|
||||
id("kotlin-multiplatform")
|
||||
@@ -584,6 +585,20 @@ tasks {
|
||||
dependsOn(mergeJsV1)
|
||||
}
|
||||
|
||||
jsV1Target.compilations["test"].compileTaskProvider.configure {
|
||||
val fs = serviceOf<FileSystemOperations>()
|
||||
val jsOutputFileName = jsOutputFileName
|
||||
val kotlinTestJsV1Output = (project.tasks.getByPath(":kotlin-test:kotlin-test-js-v1:compileKotlinJs") as Kotlin2JsCompile).outputFileProperty
|
||||
doLast {
|
||||
// copy freshly-built legacy kotlin.js into node_modules subdir of kotlin-stdlib-js-v1-test module
|
||||
fs.copy {
|
||||
from(jsOutputFileName)
|
||||
from(kotlinTestJsV1Output)
|
||||
into(destinationDirectory.dir("node_modules"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val jsResultingJar by registering(Jar::class) {
|
||||
archiveClassifier.set("js")
|
||||
archiveVersion.set("")
|
||||
|
||||
Reference in New Issue
Block a user