From 951830fcefe5bfdf80eadd6e55f7b849f0541d16 Mon Sep 17 00:00:00 2001 From: Anton Lakotka Date: Tue, 14 Nov 2023 11:29:07 +0100 Subject: [PATCH] [Gradle] Use source set name for Cinterop configurations This will ensure that source set have isolated Cinterop configurations. With proper extendsFrom relations. And prevent from dependencies i.e. from linuxMain to nativeMain if they both have the same set of underlying targets. ^KT-63338 Verification Pending --- .../native/internal/CInteropCommonizerConfigurations.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerConfigurations.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerConfigurations.kt index 950dffffbc9..fa7c85bfc62 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerConfigurations.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/CInteropCommonizerConfigurations.kt @@ -99,7 +99,7 @@ internal suspend fun Project.locateOrCreateCommonizedCInteropDependencyConfigura val commonizerTarget = sourceSet.commonizerTarget.await() ?: return null if (commonizerTarget !is SharedCommonizerTarget) return null - val configurationName = commonizerTarget.identityString + "CInterop" + val configurationName = sourceSet.name + "CInterop" configurations.findByName(configurationName)?.let { return it } val configuration = configurations.create(configurationName) { configuration -> @@ -116,7 +116,7 @@ internal suspend fun Project.locateOrCreateCommonizedCInteropDependencyConfigura * has to happen that will resolve the exact list of klibs. */ configuration.attributes.attribute(CInteropCommonizerArtifactTypeAttribute.attribute, CInteropCommonizerArtifactTypeAttribute.KLIB) - description = "Commonized CInterop dependencies for targets: '$commonizerTarget'." + description = "Commonized CInterop dependencies for $sourceSet with targets: '$commonizerTarget'." } return configuration