KT-63544: Fix Gradle CC problem in KotlinJsIrLink
This commit is contained in:
committed by
Space Team
parent
31256e259e
commit
1dbb227de2
+6
-8
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.gradle.targets.js.npm.NpmProject
|
|||||||
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
||||||
|
|
||||||
internal open class KotlinJsIrLinkConfig(
|
internal open class KotlinJsIrLinkConfig(
|
||||||
private val binary: JsIrBinary
|
private val binary: JsIrBinary,
|
||||||
) : BaseKotlin2JsCompileConfig<KotlinJsIrLink>(KotlinCompilationInfo(binary.compilation)) {
|
) : BaseKotlin2JsCompileConfig<KotlinJsIrLink>(KotlinCompilationInfo(binary.compilation)) {
|
||||||
|
|
||||||
private val compilation
|
private val compilation
|
||||||
@@ -29,10 +29,8 @@ internal open class KotlinJsIrLinkConfig(
|
|||||||
task.dependsOn(compilation.compileTaskProvider)
|
task.dependsOn(compilation.compileTaskProvider)
|
||||||
task.dependsOn(compilation.output.classesDirs)
|
task.dependsOn(compilation.output.classesDirs)
|
||||||
task.entryModule.fileProvider(
|
task.entryModule.fileProvider(
|
||||||
compilation.output.classesDirs.elements.flatMap {
|
task.project.providers.provider {
|
||||||
task.project.providers.provider {
|
compilation.output.classesDirs.elements.get().single().asFile
|
||||||
it.single().asFile
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
).disallowChanges()
|
).disallowChanges()
|
||||||
task.rootCacheDirectory.set(project.layout.buildDirectory.map { it.dir("klib/cache/js/${binary.name}") })
|
task.rootCacheDirectory.set(project.layout.buildDirectory.map { it.dir("klib/cache/js/${binary.name}") })
|
||||||
@@ -50,7 +48,7 @@ internal open class KotlinJsIrLinkConfig(
|
|||||||
|
|
||||||
override fun configureAdditionalFreeCompilerArguments(
|
override fun configureAdditionalFreeCompilerArguments(
|
||||||
task: KotlinJsIrLink,
|
task: KotlinJsIrLink,
|
||||||
compilation: KotlinCompilationInfo
|
compilation: KotlinCompilationInfo,
|
||||||
) {
|
) {
|
||||||
task.enhancedFreeCompilerArgs.value(
|
task.enhancedFreeCompilerArgs.value(
|
||||||
task.compilerOptions.freeCompilerArgs.zip(task.modeProperty) { freeArgs, mode ->
|
task.compilerOptions.freeCompilerArgs.zip(task.modeProperty) { freeArgs, mode ->
|
||||||
@@ -89,7 +87,7 @@ internal open class KotlinJsIrLinkConfig(
|
|||||||
|
|
||||||
private fun MutableList<String>.configureOptions(
|
private fun MutableList<String>.configureOptions(
|
||||||
compilation: KotlinCompilationInfo,
|
compilation: KotlinCompilationInfo,
|
||||||
vararg additionalCompilerArgs: String
|
vararg additionalCompilerArgs: String,
|
||||||
) {
|
) {
|
||||||
additionalCompilerArgs.forEach { arg ->
|
additionalCompilerArgs.forEach { arg ->
|
||||||
if (none { it.startsWith(arg) }) add(arg)
|
if (none { it.startsWith(arg) }) add(arg)
|
||||||
@@ -102,4 +100,4 @@ internal open class KotlinJsIrLinkConfig(
|
|||||||
add("$WASM_TARGET=$targetValue")
|
add("$WASM_TARGET=$targetValue")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user