Don't add Kotlin specific attributes to legacy 'default' configuration

^KT-51913 Fixed
This commit is contained in:
Yahor Berdnikau
2022-04-26 17:34:38 +02:00
committed by Space
parent c2bb8d6de0
commit cb35e868cc
2 changed files with 7 additions and 8 deletions
+7 -4
View File
@@ -267,10 +267,13 @@ fun Project.reconfigureMainSourcesSetForGradlePlugin(
wireGradleVariantToCommonGradleVariant(this, commonSourceSet)
// https://youtrack.jetbrains.com/issue/KT-51913
configurations["default"].attributes.attribute(
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named(TargetJvmEnvironment::class, "no-op")
)
// Remove workaround after bootstrap update
if (configurations["default"].attributes.contains(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE)) {
configurations["default"].attributes.attribute(
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named(TargetJvmEnvironment::class, "no-op")
)
}
plugins.withType<JavaLibraryPlugin>().configureEach {
this@reconfigureMainSourcesSetForGradlePlugin
@@ -522,10 +522,6 @@ internal abstract class AbstractKotlinPlugin(
// Setup the consuming configurations:
project.dependencies.attributesSchema.attribute(KotlinPlatformType.attribute)
project.configurations.getByName("default").apply {
setupAsLocalTargetSpecificConfigurationIfSupported(kotlinTarget)
}
// Setup the published configurations:
// Don't set the attributes for common module; otherwise their 'common' platform won't be compatible with the one in
// platform-specific modules