File tree 3 files changed +33
-18
lines changed
3 files changed +33
-18
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,14 @@ tasks.assemble {
95
95
}
96
96
97
97
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
+ }
Original file line number Diff line number Diff line change @@ -60,9 +60,14 @@ tasks.assemble {
60
60
}
61
61
62
62
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
+ }
Original file line number Diff line number Diff line change @@ -62,9 +62,14 @@ tasks.assemble {
62
62
}
63
63
64
64
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
+ }
You can’t perform that action at this time.
0 commit comments