Skip to content

Commit

Permalink
Ensure pluginCompileOnly participates in variant-aware selection
Browse files Browse the repository at this point in the history
Two variants of KGP are published as of KGP 1.7. Without specifying an
attribute to match on the consuming configuration Gradle will refuse to
match either one. Adding an attribute to match on will make Gradle select
a variant when resolving dependencies for the manually created
pluginCompileOnly configuration.
  • Loading branch information
3flex committed May 7, 2022
1 parent c36b573 commit 4b7a75d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions detekt-gradle-plugin/build.gradle.kts
Expand Up @@ -70,6 +70,10 @@ val functionalTestImplementation: Configuration by configurations.getting

configurations.compileOnly { extendsFrom(pluginCompileOnly) }

pluginCompileOnly.attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, "library"))
}

dependencies {
compileOnly(libs.kotlin.gradlePluginApi)
implementation(libs.sarif4k)
Expand Down

0 comments on commit 4b7a75d

Please sign in to comment.