Skip to content

Commit

Permalink
build: fix deprecation warning by mangling attributes instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
autonomousapps committed Jan 29, 2025
1 parent 44f764e commit 025a18f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions shadowed/antlr/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ tasks.assemble {

val javaComponent = components["java"] as AdhocComponentWithVariants
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption
configurations[unpublishable].isCanBeConsumed = false
// Hide the un-shadowed variants in local consumption, by mangling their attributes
configurations[unpublishable].attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

// Hide the un-shadowed variants in publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}
7 changes: 5 additions & 2 deletions shadowed/asm-relocated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ tasks.assemble {

val javaComponent = components["java"] as AdhocComponentWithVariants
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption
configurations[unpublishable].isCanBeConsumed = false
// Hide the un-shadowed variants in local consumption, by mangling their attributes
configurations[unpublishable].attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

// Hide the un-shadowed variants in publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}
7 changes: 5 additions & 2 deletions shadowed/kotlin-editor-relocated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ tasks.assemble {

val javaComponent = components["java"] as AdhocComponentWithVariants
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption
configurations[unpublishable].isCanBeConsumed = false
// Hide the un-shadowed variants in local consumption, by mangling their attributes
configurations[unpublishable].attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

// Hide the un-shadowed variants in publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}

0 comments on commit 025a18f

Please sign in to comment.