From c98377af7b8753cbe66165a29d6d565c37c179e4 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 16 Aug 2023 02:51:12 +0200 Subject: [PATCH] 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. --- libraries/kotlin-dom-api-compat/build.gradle.kts | 6 ++++-- libraries/kotlin.test/js/build.gradle | 2 +- libraries/kotlin.test/js/it/build.gradle | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/kotlin-dom-api-compat/build.gradle.kts b/libraries/kotlin-dom-api-compat/build.gradle.kts index e489de9ea96..eb1d66aaf4d 100644 --- a/libraries/kotlin-dom-api-compat/build.gradle.kts +++ b/libraries/kotlin-dom-api-compat/build.gradle.kts @@ -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) + } } } } diff --git a/libraries/kotlin.test/js/build.gradle b/libraries/kotlin.test/js/build.gradle index 1ec1e305a85..9d18f1a5632 100644 --- a/libraries/kotlin.test/js/build.gradle +++ b/libraries/kotlin.test/js/build.gradle @@ -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) } diff --git a/libraries/kotlin.test/js/it/build.gradle b/libraries/kotlin.test/js/it/build.gradle index 7aa280fd8cb..419dfb30cb8 100644 --- a/libraries/kotlin.test/js/it/build.gradle +++ b/libraries/kotlin.test/js/it/build.gradle @@ -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) }