Skip to content

Commit 9bbf7c8

Browse files
committed
[Java] Use custom configuration to build shadow jar with correct POM.
1 parent 35d1a50 commit 9bbf7c8

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

build.gradle

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,19 @@ project(':sbe-tool') {
301301
project(':sbe-all') {
302302
apply plugin: 'com.github.johnrengelman.shadow'
303303

304+
configurations {
305+
customApi
306+
}
307+
304308
dependencies {
305-
implementation project(':sbe-tool')
309+
customApi project(':sbe-tool')
310+
}
311+
312+
sourceSets {
313+
main {
314+
compileClasspath += configurations.customApi
315+
runtimeClasspath += compileClasspath
316+
}
306317
}
307318

308319
task sourcesJar(type: Jar) {
@@ -311,6 +322,7 @@ project(':sbe-all') {
311322
}
312323

313324
javadoc {
325+
classpath += configurations.customApi
314326
source += project(':sbe-tool').sourceSets.main.allJava
315327
}
316328

@@ -320,7 +332,7 @@ project(':sbe-all') {
320332
}
321333

322334
shadowJar {
323-
mustRunAfter jar
335+
configurations = [project.configurations.customApi]
324336
archiveClassifier.set ''
325337
manifest.attributes(
326338
'Main-Class': 'uk.co.real_logic.sbe.SbeTool',
@@ -333,6 +345,8 @@ project(':sbe-all') {
333345
)
334346
}
335347

348+
jar.finalizedBy shadowJar
349+
336350
uploadArchives {
337351
repositories {
338352
mavenDeployer {
@@ -519,11 +533,12 @@ project(':sbe-benchmarks') {
519533
}
520534

521535
shadowJar {
522-
mustRunAfter jar
523536
archiveFileName = 'sbe-benchmarks.jar'
524537
archiveClassifier.set 'benchmarks'
525538
manifest.attributes('Main-Class': 'org.openjdk.jmh.Main')
526539
}
540+
541+
jar.finalizedBy shadowJar
527542
}
528543

529544
/*

0 commit comments

Comments
 (0)