Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: fix deprecation warning by mangling attributes instead.
Browse files Browse the repository at this point in the history
autonomousapps committed Jan 30, 2025

Verified

This commit was signed with the committer’s verified signature.
1 parent 44f764e commit 5ef4428
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
@@ -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(Usage.USAGE_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
@@ -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(Usage.USAGE_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
@@ -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(Usage.USAGE_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

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

0 comments on commit 5ef4428

Please sign in to comment.