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 30, 2025
1 parent 44f764e commit f69b67a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
17 changes: 11 additions & 6 deletions shadowed/antlr/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ 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 publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}
listOf("apiElements", "runtimeElements")
.map { configurations[it] }
.forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption, by mangling their attributes
unpublishable.attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

// Hide the un-shadowed variants in publishing
javaComponent.withVariantsFromConfiguration(unpublishable) { skip() }
}
17 changes: 11 additions & 6 deletions shadowed/asm-relocated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ 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 publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}
listOf("apiElements", "runtimeElements")
.map { configurations[it] }
.forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption, by mangling their attributes
unpublishable.attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

// Hide the un-shadowed variants in publishing
javaComponent.withVariantsFromConfiguration(unpublishable) { skip() }
}
17 changes: 11 additions & 6 deletions shadowed/kotlin-editor-relocated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ 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 publishing
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
}
listOf("apiElements", "runtimeElements")
.map { configurations[it] }
.forEach { unpublishable ->
// Hide the un-shadowed variants in local consumption, by mangling their attributes
unpublishable.attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
}

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

0 comments on commit f69b67a

Please sign in to comment.