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 20, 2022
1 parent c62568d commit b2e9f4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions detekt-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
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 b2e9f4d

Please sign in to comment.