Skip to content

Commit 7238432

Browse files
committed
Use io.freefair.aggregate-javadoc plugin
(cherry picked from commit 8df5c43) # Conflicts: # build.gradle
1 parent 67d8605 commit 7238432

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
@@ -23,6 +23,7 @@ plugins {
2323
id 'org.antora' version '1.0.0'
2424
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
2525
id 'com.github.spotbugs' version '6.0.19'
26+
id 'io.freefair.aggregate-javadoc' version '8.6'
2627
}
2728

2829
if (isCI) {
@@ -207,6 +208,11 @@ configure(javaProjects) { subproject ->
207208
attribute(scopeAttribute, 'provided')
208209
}
209210
}
211+
212+
[compileClasspath, testCompileClasspath, testRuntimeClasspath].each {
213+
it.extendsFrom(optional)
214+
it.extendsFrom(provided)
215+
}
210216
}
211217

212218
components.java.with {
@@ -226,13 +232,6 @@ configure(javaProjects) { subproject ->
226232
}
227233
}
228234

229-
[configurations.optional, configurations.provided].each { scoped ->
230-
sourceSets.all {
231-
compileClasspath += scoped
232-
runtimeClasspath += scoped
233-
}
234-
}
235-
236235
java {
237236
withJavadocJar()
238237
withSourcesJar()
@@ -1102,28 +1101,34 @@ project('spring-integration-bom') {
11021101
}
11031102
}
11041103

1105-
tasks.register('api', Javadoc) {
1106-
group = 'Documentation'
1107-
description = 'Generates aggregated Javadoc API documentation.'
1104+
dependencies {
1105+
javaProjects.each {
1106+
javadoc it
1107+
}
1108+
}
1109+
1110+
javadoc {
11081111
title = "${rootProject.description} ${version} API"
11091112
options {
11101113
encoding = 'UTF-8'
11111114
memberLevel = JavadocMemberLevel.PROTECTED
11121115
author = true
1113-
header = rootProject.description
1116+
header = project.description
11141117
use = true
11151118
overview = 'src/api/overview.html'
11161119
splitIndex = true
11171120
links(project.ext.javadocLinks)
11181121
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
11191122
}
11201123

1121-
source javaProjects.collect { project ->
1122-
project.sourceSets.main.allJava
1123-
}
1124-
destinationDir = new File('build', 'api')
1124+
destinationDir = file('build/api')
11251125
classpath = files().from { files(javaProjects.collect { it.sourceSets.main.compileClasspath }) }
1126+
}
11261127

1128+
tasks.register('api') {
1129+
group = 'Documentation'
1130+
description = 'Generates aggregated Javadoc API documentation.'
1131+
dependsOn javadoc
11271132
}
11281133

11291134
dokkaHtmlMultiModule {
@@ -1180,7 +1185,7 @@ tasks.register('docsZip', Zip) {
11801185
include 'changelog.txt'
11811186
}
11821187

1183-
from(api) {
1188+
from(javadoc) {
11841189
into 'api'
11851190
}
11861191

0 commit comments

Comments
 (0)