mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 15:51:01 +00:00
Set canBeConsumed = false on the deprecated configurations like compile
This leads to cleaner error messages in Gradle variant-aware dependency resolution failures. Gradle has deprecated those configurations since long ago, and we didn't see much use of them as variant-aware dependency resolution entities either. So this commits sets `canBeConsumed` to false on these configuratons: * compile (+ testCompile, fooCompile in MPP) * runtime (+ testRuntime, fooRuntime, ...) * compileOnly (+ testCompileOnly, fooCompileOnly, ...) * default (+ fooDefault in MPP) This change replaces the PR #3995
This commit is contained in:
@@ -187,6 +187,10 @@ class VariantAwareDependenciesIT : BaseGradleIT() {
|
||||
with(outerProject) {
|
||||
embedProject(innerProject)
|
||||
|
||||
gradleBuildScript().appendText(
|
||||
"\nconfigurations['jvm6TestRuntime'].canBeConsumed = true"
|
||||
)
|
||||
|
||||
gradleBuildScript(innerProject.projectName).appendText(
|
||||
"\ndependencies { testCompile project(path: ':', configuration: 'jvm6TestRuntime') }"
|
||||
)
|
||||
|
||||
@@ -38,6 +38,8 @@ object ProjectLocalConfigurations {
|
||||
}
|
||||
|
||||
internal fun Configuration.setupAsLocalTargetSpecificConfigurationIfSupported(target: KotlinTarget) {
|
||||
isCanBeConsumed = false
|
||||
|
||||
// don't setup in old MPP common modules, as their output configurations with KotlinPlatformType attribute would
|
||||
// fail to resolve as transitive dependencies of the platform modules, just as we don't mark their
|
||||
// `api/RuntimeElements` with the KotlinPlatformType
|
||||
|
||||
Reference in New Issue
Block a user