[Gradle] Ensure deprecated *DependenciesMetadata configurations carry necessary dependencies
^KT-55929 Verification Pending
This commit is contained in:
committed by
Space Team
parent
fbc39fcab1
commit
cc684cce3d
+20
-1
@@ -364,8 +364,27 @@ class KotlinMetadataTargetConfigurator :
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (sourceSet is DefaultKotlinSourceSet)
|
@Suppress("DEPRECATION")
|
||||||
|
if (sourceSet is DefaultKotlinSourceSet) {
|
||||||
sourceSet.compileDependenciesTransformation = granularMetadataTransformation
|
sourceSet.compileDependenciesTransformation = granularMetadataTransformation
|
||||||
|
|
||||||
|
/*
|
||||||
|
Older IDEs still rely on resolving the metadata configurations explicitly.
|
||||||
|
Dependencies will be coming from extending the newer 'resolvableMetadataConfiguration'.
|
||||||
|
|
||||||
|
the intransitiveMetadataConfigurationName will not extend this mechanism, since it only
|
||||||
|
relies on dependencies being added explicitly by the Kotlin Gradle Plugin
|
||||||
|
*/
|
||||||
|
listOf(
|
||||||
|
sourceSet.apiMetadataConfigurationName,
|
||||||
|
sourceSet.implementationMetadataConfigurationName,
|
||||||
|
sourceSet.compileOnlyMetadataConfigurationName
|
||||||
|
).forEach { configurationName ->
|
||||||
|
val configuration = project.configurations.getByName(configurationName)
|
||||||
|
configuration.extendsFrom(sourceSet.resolvableMetadataConfiguration)
|
||||||
|
granularMetadataTransformation.applyToConfiguration(configuration)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Ensure that the [configuration] excludes the dependencies that are classified by this [GranularMetadataTransformation] as
|
/** Ensure that the [configuration] excludes the dependencies that are classified by this [GranularMetadataTransformation] as
|
||||||
|
|||||||
Reference in New Issue
Block a user