Fix Android Lint dependency resolution issues (KT-49483)
Android Gradle plugin resolves the *Classpath configurations in an artifact view with an artifactType attribute set, which should give a resolved variant with a different `org.gradle.category` attribute. With `org.gradle.category=library` set by the Kotlin Gradle plugin, that couldn't work. To fix this, don't set the `org.gradle.category` attribute on the Android resolvable configurations. TODO: Add integration tests!
This commit is contained in:
+6
-2
@@ -329,7 +329,9 @@ abstract class AbstractKotlinTargetConfigurator<KotlinTargetType : KotlinTarget>
|
||||
isVisible = false
|
||||
isCanBeConsumed = false
|
||||
attributes.attribute(USAGE_ATTRIBUTE, KotlinUsages.consumerApiUsage(compilation.target))
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
if (compilation.platformType != KotlinPlatformType.androidJvm) {
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
}
|
||||
description = "Compile classpath for $compilation."
|
||||
}
|
||||
|
||||
@@ -359,7 +361,9 @@ abstract class AbstractKotlinTargetConfigurator<KotlinTargetType : KotlinTarget>
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
attributes.attribute(USAGE_ATTRIBUTE, KotlinUsages.consumerRuntimeUsage(compilation.target))
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
if (compilation.platformType != KotlinPlatformType.androidJvm) {
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.categoryByName(Category.LIBRARY))
|
||||
}
|
||||
description = "Runtime classpath of $compilation."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user