Merge pull request #45223 from ngocnhan-tran1996

* gh-45223:
  Polish "Avoid eager creation of aggregatedJavadoc task"
  Avoid eager creation of aggregatedJavadoc task

Closes gh-45223
This commit is contained in:
Andy Wilkinson 2025-04-17 14:12:02 +01:00
commit 6d18ea5e11
1 changed files with 23 additions and 20 deletions

View File

@ -201,29 +201,32 @@ dokkatoo {
moduleName.set("Spring Boot Kotlin API")
}
task aggregatedJavadoc(type: Javadoc) {
project.rootProject.gradle.projectsEvaluated {
Set<Project> publishedProjects = rootProject.subprojects.findAll { it != project }
.findAll { it.plugins.hasPlugin(JavaPlugin) && it.plugins.hasPlugin(MavenPublishPlugin) }
.findAll { !it.path.contains(":spring-boot-tools:") ||
it.path.contains(":spring-boot-tools:spring-boot-buildpack-platform") ||
it.path.contains(":spring-boot-tools:spring-boot-loader-tools") ||
(it.path.contains(":spring-boot-tools:spring-boot-loader") && !it.path.contains("spring-boot-loader-classic"))}
.findAll { !it.name.startsWith('spring-boot-starter') }
def aggregatedJavadoc = tasks.register('aggregatedJavadoc', Javadoc) {
destinationDir = project.file(project.layout.buildDirectory.dir("docs/javadoc"))
options {
author = true
docTitle = "Spring Boot ${project.version} API"
memberLevel = "protected"
outputLevel = "quiet"
splitIndex = true
use = true
windowTitle = "Spring Boot ${project.version} API"
}
doFirst(new ConfigureJavadocLinks(configurations.resolvedBom, ["Spring Framework", "Spring Security", "Tomcat"]))
}
project.rootProject.gradle.projectsEvaluated {
Set<Project> publishedProjects = rootProject.subprojects.findAll { it != project }
.findAll { it.plugins.hasPlugin(JavaPlugin) && it.plugins.hasPlugin(MavenPublishPlugin) }
.findAll { !it.path.contains(":spring-boot-tools:") ||
it.path.contains(":spring-boot-tools:spring-boot-buildpack-platform") ||
it.path.contains(":spring-boot-tools:spring-boot-loader-tools") ||
(it.path.contains(":spring-boot-tools:spring-boot-loader") && !it.path.contains("spring-boot-loader-classic"))}
.findAll { !it.name.startsWith('spring-boot-starter') }
aggregatedJavadoc.configure {
dependsOn publishedProjects.javadoc
source publishedProjects.javadoc.source
classpath = project.files(publishedProjects.javadoc.classpath)
destinationDir = project.file(project.layout.buildDirectory.dir("docs/javadoc"))
options {
author = true
docTitle = "Spring Boot ${project.version} API"
memberLevel = "protected"
outputLevel = "quiet"
splitIndex = true
use = true
windowTitle = "Spring Boot ${project.version} API"
}
doFirst(new ConfigureJavadocLinks(configurations.resolvedBom, ["Spring Framework", "Spring Security", "Tomcat"]))
}
}