Fixup for the fix of KT-47506 interfering with CInterop changes

As the `*Default` configurations are gone, each K/N target now has two
consumable configuration, the `*ApiElements` and the
`*CInteropApiElements`. They have diverging sets of attributes (both
more concrete than `*Default` had).

To make their attribute sets non-diverging, we set the
local-to-project=public on the `*CInteropApiElements` in order to match
the same attribute on the `*ApiElements` configuration

Related to the original fix of KT-47506
This commit is contained in:
Sergey Igushkin
2021-08-05 18:47:12 +04:00
committed by Space
parent 11f951e6d1
commit 395b2119a1
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.DefaultCInteropSettings
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
import org.jetbrains.kotlin.gradle.plugin.setupAsPublicConfigurationIfSupported
import org.jetbrains.kotlin.gradle.plugin.usesPlatformOf
import org.jetbrains.kotlin.gradle.targets.native.internal.CInteropKlibLibraryElements.cinteropKlibLibraryElements
import org.jetbrains.kotlin.gradle.tasks.CInteropProcess
@@ -63,6 +64,7 @@ internal fun Project.locateOrCreateCInteropApiElementsConfiguration(target: Kotl
return configurations.create(configurationName).apply {
isCanBeResolved = false
isCanBeConsumed = true
setupAsPublicConfigurationIfSupported(target)
usesPlatformOf(target)
attributes.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, cinteropKlibLibraryElements())