[Gradle] Don't make native compilation api configuration resolvable
Instead, create a resolvableDetached configuration for that purpose. Changing configuration roles is deprecated since Gradle 8.2 ^KT-60879
This commit is contained in:
-12
@@ -18,18 +18,6 @@ import org.jetbrains.kotlin.gradle.utils.maybeCreateResolvable
|
||||
internal val ConfigureFrameworkExportSideEffect = KotlinTargetSideEffect<KotlinNativeTarget> { target ->
|
||||
val project = target.project
|
||||
|
||||
target.compilations.all {
|
||||
// Allow resolving api configurations directly to be able to check that
|
||||
// all exported dependency are also added in the corresponding api configurations.
|
||||
// The check is performed during a link task execution.
|
||||
project.configurations.maybeCreate(it.apiConfigurationName).apply {
|
||||
isCanBeResolved = true
|
||||
usesPlatformOf(target)
|
||||
attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.consumerApiUsage(target))
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
}
|
||||
}
|
||||
|
||||
target.binaries.withType(AbstractNativeLibrary::class.java).all { framework ->
|
||||
project.configurations.maybeCreateResolvable(framework.exportConfigurationName).apply {
|
||||
isVisible = false
|
||||
|
||||
+14
-1
@@ -10,6 +10,8 @@ import groovy.lang.Closure
|
||||
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
||||
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
|
||||
import org.gradle.api.artifacts.result.ResolvedDependencyResult
|
||||
import org.gradle.api.attributes.Category
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.api.file.ConfigurableFileCollection
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.FileCollection
|
||||
@@ -23,8 +25,10 @@ import org.jetbrains.kotlin.gradle.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.create
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
|
||||
import org.jetbrains.kotlin.gradle.plugin.categoryByName
|
||||
import org.jetbrains.kotlin.gradle.plugin.cocoapods.asValidFrameworkName
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.usesPlatformOf
|
||||
import org.jetbrains.kotlin.gradle.report.UsesBuildMetricsService
|
||||
import org.jetbrains.kotlin.gradle.targets.native.UsesKonanPropertiesBuildService
|
||||
import org.jetbrains.kotlin.gradle.targets.native.tasks.CompilerPluginData
|
||||
@@ -196,7 +200,16 @@ constructor(
|
||||
(binary as? Framework)?.embedBitcodeMode ?: objectFactory.property()
|
||||
|
||||
@get:Internal
|
||||
val apiFiles = project.files(project.configurations.getByName(compilation.apiConfigurationName)).filterKlibsPassedToCompiler()
|
||||
val apiFiles = project
|
||||
.configurations
|
||||
.detachedResolvable()
|
||||
.apply @Suppress("DEPRECATION") {
|
||||
val apiConfiguration = project.configurations.getByName(compilation.apiConfigurationName)
|
||||
dependencies.addAll(apiConfiguration.allDependencies)
|
||||
usesPlatformOf(compilation.target)
|
||||
attributes.attribute(Usage.USAGE_ATTRIBUTE, KotlinUsages.consumerApiUsage(compilation.target))
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
}.filterKlibsPassedToCompiler()
|
||||
|
||||
@get:Optional
|
||||
@get:InputFile
|
||||
|
||||
Reference in New Issue
Block a user