From 3686c457bbc46b92ee22181158d40019a075a787 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 7 Sep 2023 15:29:25 +0200 Subject: [PATCH] Polish Aggregate Javadoc task Closes gh-31173 --- build.gradle | 5 ++--- .../build/optional/OptionalDependenciesPlugin.java | 5 +++-- framework-api/framework-api.gradle | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index d6cf49ed03..e8c3550a7c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'io.freefair.aspectj' version '8.2.2' apply false + id 'io.freefair.aspectj' version '8.3' apply false // kotlinVersion is managed in gradle.properties id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlinVersion}" apply false id 'org.jetbrains.dokka' version '1.8.20' @@ -18,6 +18,7 @@ ext { configure(allprojects) { project -> apply plugin: "org.springframework.build.localdev" + group = "org.springframework" repositories { mavenCentral() maven { @@ -57,8 +58,6 @@ configure(allprojects - project(":framework-platform")) { } configure([rootProject] + javaProjects) { project -> - group = "org.springframework" - apply plugin: "java" apply plugin: "java-test-fixtures" apply plugin: 'org.springframework.build.conventions' diff --git a/buildSrc/src/main/java/org/springframework/build/optional/OptionalDependenciesPlugin.java b/buildSrc/src/main/java/org/springframework/build/optional/OptionalDependenciesPlugin.java index d8c188f4ce..8e3898360a 100644 --- a/buildSrc/src/main/java/org/springframework/build/optional/OptionalDependenciesPlugin.java +++ b/buildSrc/src/main/java/org/springframework/build/optional/OptionalDependenciesPlugin.java @@ -19,6 +19,7 @@ package org.springframework.build.optional; import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; +import org.gradle.api.plugins.JavaBasePlugin; import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPluginExtension; import org.gradle.api.tasks.SourceSetContainer; @@ -40,10 +41,10 @@ public class OptionalDependenciesPlugin implements Plugin { @Override public void apply(Project project) { - Configuration optional = project.getConfigurations().create("optional"); + Configuration optional = project.getConfigurations().create(OPTIONAL_CONFIGURATION_NAME); optional.setCanBeConsumed(false); optional.setCanBeResolved(false); - project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> { + project.getPlugins().withType(JavaBasePlugin.class, (javaBasePlugin) -> { SourceSetContainer sourceSets = project.getExtensions().getByType(JavaPluginExtension.class) .getSourceSets(); sourceSets.all((sourceSet) -> { diff --git a/framework-api/framework-api.gradle b/framework-api/framework-api.gradle index b88413dc9b..d70edcdde5 100644 --- a/framework-api/framework-api.gradle +++ b/framework-api/framework-api.gradle @@ -1,6 +1,6 @@ plugins { id 'java-platform' - id 'io.freefair.aggregate-javadoc' version '8.2.2' + id 'io.freefair.aggregate-javadoc' version '8.3' } description = "Spring Framework API Docs" @@ -14,7 +14,7 @@ repositories { } dependencies { - rootProject.subprojects.findAll { it.name.startsWith("spring-") }.each { moduleProject -> + moduleProjects.each { moduleProject -> javadoc moduleProject } } @@ -34,12 +34,12 @@ javadoc { addBooleanOption('Werror', true) // fail build on Javadoc warnings } maxMemory = "1024m" - destinationDir = file("$buildDir/docs/javadoc") doFirst { classpath += files( // ensure the javadoc process can resolve types compiled from .aj sources project(":spring-aspects").sourceSets.main.output ) + classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath }) } }