Skip to content

Commit f69b67a

Browse files
build: fix deprecation warning by mangling attributes instead.
1 parent 44f764e commit f69b67a

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

shadowed/antlr/build.gradle.kts

+11-6
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,14 @@ tasks.assemble {
9595
}
9696

9797
val javaComponent = components["java"] as AdhocComponentWithVariants
98-
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
99-
// Hide the un-shadowed variants in local consumption
100-
configurations[unpublishable].isCanBeConsumed = false
101-
// Hide the un-shadowed variants in publishing
102-
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
103-
}
98+
listOf("apiElements", "runtimeElements")
99+
.map { configurations[it] }
100+
.forEach { unpublishable ->
101+
// Hide the un-shadowed variants in local consumption, by mangling their attributes
102+
unpublishable.attributes {
103+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
104+
}
105+
106+
// Hide the un-shadowed variants in publishing
107+
javaComponent.withVariantsFromConfiguration(unpublishable) { skip() }
108+
}

shadowed/asm-relocated/build.gradle.kts

+11-6
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ tasks.assemble {
6060
}
6161

6262
val javaComponent = components["java"] as AdhocComponentWithVariants
63-
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
64-
// Hide the un-shadowed variants in local consumption
65-
configurations[unpublishable].isCanBeConsumed = false
66-
// Hide the un-shadowed variants in publishing
67-
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
68-
}
63+
listOf("apiElements", "runtimeElements")
64+
.map { configurations[it] }
65+
.forEach { unpublishable ->
66+
// Hide the un-shadowed variants in local consumption, by mangling their attributes
67+
unpublishable.attributes {
68+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
69+
}
70+
71+
// Hide the un-shadowed variants in publishing
72+
javaComponent.withVariantsFromConfiguration(unpublishable) { skip() }
73+
}

shadowed/kotlin-editor-relocated/build.gradle.kts

+11-6
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ tasks.assemble {
6262
}
6363

6464
val javaComponent = components["java"] as AdhocComponentWithVariants
65-
listOf("apiElements", "runtimeElements").forEach { unpublishable ->
66-
// Hide the un-shadowed variants in local consumption
67-
configurations[unpublishable].isCanBeConsumed = false
68-
// Hide the un-shadowed variants in publishing
69-
javaComponent.withVariantsFromConfiguration(configurations[unpublishable]) { skip() }
70-
}
65+
listOf("apiElements", "runtimeElements")
66+
.map { configurations[it] }
67+
.forEach { unpublishable ->
68+
// Hide the un-shadowed variants in local consumption, by mangling their attributes
69+
unpublishable.attributes {
70+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named("DO_NOT_USE"))
71+
}
72+
73+
// Hide the un-shadowed variants in publishing
74+
javaComponent.withVariantsFromConfiguration(unpublishable) { skip() }
75+
}

0 commit comments

Comments
 (0)