Add js compiler disambiguation attribute to fix errors on project import

There were remaining configurations in legacy JS projects with amiguous attributes requesting kotlin-stdlib. They are not used in build, but resolved on import.
This commit is contained in:
Ilya Gorbunov
2023-08-16 02:51:12 +02:00
committed by Space Team
parent e380610ab0
commit c98377af7b
3 changed files with 6 additions and 4 deletions
@@ -29,8 +29,10 @@ kotlin {
val test by compilations.getting
// TODO: Remove together with kotlin.js.compiler.publish.attribute=false property
listOf(main, test).forEach { compilation ->
configurations[compilation.compileDependencyConfigurationName].attributes {
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir)
listOf(compilation.compileDependencyConfigurationName, compilation.runtimeDependencyConfigurationName).forEach { configurationName ->
configurations[configurationName].attributes {
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir)
}
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ apply plugin: 'kotlin-platform-js'
configurations {
distJs
distLibrary
[compileClasspath, testCompileClasspath, testRuntimeClasspath].forEach {
[compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath].forEach {
it.attributes {
attribute(org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute.jsCompilerAttribute, org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute.legacy)
}
+1 -1
View File
@@ -20,7 +20,7 @@ configurations {
attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.legacy)
}
}
[compileClasspath, testCompileClasspath, testRuntimeClasspath].forEach {
[compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath].forEach {
it.attributes {
attribute(org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute.jsCompilerAttribute, org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute.legacy)
}