Skip to content

Commit 2b5ebd0

Browse files
artembilanspring-builds
authored andcommitted
Use io.freefair.aggregate-javadoc plugin
(cherry picked from commit 8df5c43)
1 parent 6ae8f73 commit 2b5ebd0

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

build.gradle

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
2525
id 'com.github.spotbugs' version '6.0.19'
2626
id 'com.google.protobuf' version '0.9.4' apply false
27+
id 'io.freefair.aggregate-javadoc' version '8.6'
2728
}
2829

2930
if (isCI) {
@@ -217,6 +218,11 @@ configure(javaProjects) { subproject ->
217218
attribute(scopeAttribute, 'provided')
218219
}
219220
}
221+
222+
[compileClasspath, testCompileClasspath, testRuntimeClasspath].each {
223+
it.extendsFrom(optional)
224+
it.extendsFrom(provided)
225+
}
220226
}
221227

222228
components.java.with {
@@ -236,13 +242,6 @@ configure(javaProjects) { subproject ->
236242
}
237243
}
238244

239-
[configurations.optional, configurations.provided].each { scoped ->
240-
sourceSets.all {
241-
compileClasspath += scoped
242-
runtimeClasspath += scoped
243-
}
244-
}
245-
246245
java {
247246
withJavadocJar()
248247
withSourcesJar()
@@ -1113,28 +1112,34 @@ project('spring-integration-bom') {
11131112
}
11141113
}
11151114

1116-
tasks.register('api', Javadoc) {
1117-
group = 'Documentation'
1118-
description = 'Generates aggregated Javadoc API documentation.'
1115+
dependencies {
1116+
javaProjects.each {
1117+
javadoc it
1118+
}
1119+
}
1120+
1121+
javadoc {
11191122
title = "${rootProject.description} ${version} API"
11201123
options {
11211124
encoding = 'UTF-8'
11221125
memberLevel = JavadocMemberLevel.PROTECTED
11231126
author = true
1124-
header = rootProject.description
1127+
header = project.description
11251128
use = true
11261129
overview = 'src/api/overview.html'
11271130
splitIndex = true
11281131
links(project.ext.javadocLinks)
11291132
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
11301133
}
11311134

1132-
source javaProjects.collect { project ->
1133-
project.sourceSets.main.allJava
1134-
}
1135-
destinationDir = new File('build', 'api')
1135+
destinationDir = file('build/api')
11361136
classpath = files().from { files(javaProjects.collect { it.sourceSets.main.compileClasspath }) }
1137+
}
11371138

1139+
tasks.register('api') {
1140+
group = 'Documentation'
1141+
description = 'Generates aggregated Javadoc API documentation.'
1142+
dependsOn javadoc
11381143
}
11391144

11401145
dokkaHtmlMultiModule {
@@ -1191,7 +1196,7 @@ tasks.register('docsZip', Zip) {
11911196
include 'changelog.txt'
11921197
}
11931198

1194-
from(api) {
1199+
from(javadoc) {
11951200
into 'api'
11961201
}
11971202

0 commit comments

Comments
 (0)