File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,32 @@ tasks {
7474 archiveClassifier.set(" " )
7575 }
7676
77+ jar {
78+ archiveClassifier.set(" noshadow" )
79+ }
80+
7781 withType<Test >().configureEach {
7882 dependsOn(shadowJar)
7983 systemProperty(" shadow.jar.path" , shadowJar.get().archiveFile.get().asFile.absolutePath)
8084 systemProperty(" gradle.project.version" , " ${project.version} " )
8185 }
86+
87+ // Because we reconfigure publishing to only include the shadow jar, the Gradle metadata is not correct.
88+ // Since we are fully bundled and have no dependencies, Gradle metadata wouldn't provide any advantage over
89+ // the POM anyways so in practice we shouldn't be losing anything.
90+ withType<GenerateModuleMetadata >().configureEach {
91+ enabled = false
92+ }
93+ }
94+
95+ // Don't publish non-shadowed jar (shadowJar is in shadowRuntimeElements)
96+ with (components[" java" ] as AdhocComponentWithVariants ) {
97+ configurations.forEach {
98+ withVariantsFromConfiguration(configurations[" apiElements" ]) {
99+ skip()
100+ }
101+ withVariantsFromConfiguration(configurations[" runtimeElements" ]) {
102+ skip()
103+ }
104+ }
82105}
You can’t perform that action at this time.
0 commit comments