File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ repositories {
1010 mavenCentral()
1111}
1212
13+ java {
14+ withJavadocJar()
15+ withSourcesJar()
16+ }
17+
1318val embed by configurations.creating {
1419 isTransitive = false
1520}
@@ -25,3 +30,15 @@ tasks.jar {
2530 dependsOn(embed)
2631 from(embed.map { zipTree(it) })
2732}
33+ tasks.javadoc {
34+ dependsOn(embed)
35+ setSource(subprojects.map { it.sourceSets.main.get().allSource })
36+ classpath = files(subprojects.flatMap { it.sourceSets.main.get().compileClasspath })
37+ if (JavaVersion .current().isJava9Compatible) {
38+ (options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
39+ }
40+ }
41+ tasks.named<Jar >(" sourcesJar" ) {
42+ dependsOn(embed)
43+ from(subprojects.map { it.sourceSets.main.get().allSource })
44+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ tasks.register<JavaExec>("generateGlue") {
3636tasks.compileJava {
3737 dependsOn(tasks.named(" generateGlue" ))
3838}
39+ tasks.named(" sourcesJar" ) {
40+ dependsOn(tasks.named(" generateGlue" ))
41+ }
3942
4043tasks.jar {
4144 // glue classes only contain large string constants that get inlined into other classes
Original file line number Diff line number Diff line change @@ -19,11 +19,19 @@ java {
1919 toolchain {
2020 languageVersion = JavaLanguageVersion .of(17 )
2121 }
22+ withJavadocJar()
23+ withSourcesJar()
2224}
2325tasks.withType<JavaCompile >().configureEach {
2426 options.release = 8
2527}
2628
29+ tasks.javadoc {
30+ if (JavaVersion .current().isJava9Compatible) {
31+ (options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
32+ }
33+ }
34+
2735dependencies {
2836 compileOnly(libs.spotbugs.annotations)
2937 testCompileOnly(libs.spotbugs.annotations)
You can’t perform that action at this time.
0 commit comments