Rework Antora Gradle Infrastructure
Closes gh-40572 Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "org.antora"
|
||||
id "org.springframework.boot.antora-contributor"
|
||||
id "org.springframework.boot.auto-configuration"
|
||||
id "org.springframework.boot.configuration-properties"
|
||||
id "org.springframework.boot.deployed"
|
||||
@@ -9,10 +9,6 @@ plugins {
|
||||
|
||||
description = "Spring Boot Actuator AutoConfigure"
|
||||
|
||||
configurations {
|
||||
antoraContent
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-actuator"))
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
@@ -215,36 +211,18 @@ def documentationTest = tasks.register("documentationTest", Test) {
|
||||
}
|
||||
}
|
||||
|
||||
def antoraActuatorRestApiLocalAggregateContent = tasks.register("antoraActuatorRestApiLocalAggregateContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "actuator-rest-api-local-aggregate-content"
|
||||
from(tasks.getByName("generateAntoraYml")) {
|
||||
into "modules"
|
||||
antoraContributions {
|
||||
'actuator-rest-api' {
|
||||
aggregateContent {
|
||||
from(documentationTest.map { layout.buildDirectory.dir("generated-snippets") }) {
|
||||
into "modules/api/partials/rest/actuator"
|
||||
}
|
||||
}
|
||||
localAggregateContent {
|
||||
from(tasks.named("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
source()
|
||||
}
|
||||
}
|
||||
|
||||
def antoraActuatorRestApiAggregateContent = tasks.register("antoraActuatorRestApiAggregateContent", Zip) {
|
||||
dependsOn documentationTest
|
||||
inputs.dir(layout.buildDirectory.dir("generated-snippets"))
|
||||
.withPathSensitivity(PathSensitivity.RELATIVE)
|
||||
.withPropertyName("generatedSnippets")
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "actuator-rest-api-aggregate-content"
|
||||
from(layout.buildDirectory.dir("generated-snippets")) {
|
||||
into "modules/api/partials/rest/actuator"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("generateAntoraPlaybook") {
|
||||
alwaysInclude = [name: "actuator-rest-api", classifier: "local-aggregate-content"]
|
||||
dependsOn antoraActuatorRestApiLocalAggregateContent
|
||||
}
|
||||
|
||||
tasks.named("antora") {
|
||||
inputs.files(antoraActuatorRestApiAggregateContent)
|
||||
}
|
||||
|
||||
artifacts {
|
||||
antoraContent antoraActuatorRestApiAggregateContent
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ plugins {
|
||||
id "dev.adamko.dokkatoo-html"
|
||||
id "java"
|
||||
id "org.antora"
|
||||
id "org.springframework.boot.antora-contributor"
|
||||
id "org.springframework.boot.antora-dependencies"
|
||||
id "org.springframework.boot.deployed"
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
@@ -14,7 +16,6 @@ configurations {
|
||||
remoteSpringApplicationExample
|
||||
springApplicationExample
|
||||
testSlices
|
||||
antoraContent
|
||||
all {
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
|
||||
@@ -179,10 +180,6 @@ dependencies {
|
||||
springApplicationExample(platform(project(":spring-boot-project:spring-boot-dependencies")))
|
||||
springApplicationExample(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
|
||||
|
||||
antoraContent(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure", configuration: "antoraContent"))
|
||||
antoraContent(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "antoraContent"))
|
||||
antoraContent(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-maven-plugin", configuration: "antoraContent"))
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation("org.assertj:assertj-core")
|
||||
@@ -308,86 +305,86 @@ def getRelativeExamplesPath(var outputs) {
|
||||
'example$example-output/' + fileName
|
||||
}
|
||||
|
||||
def antoraRootAggregateContent = tasks.register("antoraRootAggregateContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "root-aggregate-content"
|
||||
from("src/main") {
|
||||
into "modules/ROOT/examples"
|
||||
antoraDependencies {
|
||||
'actuator-rest-api' {
|
||||
path = ":spring-boot-project:spring-boot-actuator-autoconfigure"
|
||||
source()
|
||||
aggregateContent()
|
||||
}
|
||||
from(project.configurations.configurationProperties) {
|
||||
eachFile {
|
||||
it.path = rootProject
|
||||
.projectDir
|
||||
.toPath()
|
||||
.relativize(it.file.toPath())
|
||||
.toString()
|
||||
.replace('\\', '/')
|
||||
.replaceAll('.*/([^/]+)/build.*', 'modules/ROOT/partials/$1/spring-configuration-metadata.json')
|
||||
'gradle-plugin' {
|
||||
path = ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin"
|
||||
source()
|
||||
catalogContent()
|
||||
}
|
||||
'maven-plugin' {
|
||||
path = ":spring-boot-project:spring-boot-tools:spring-boot-maven-plugin"
|
||||
source()
|
||||
catalogContent()
|
||||
aggregateContent()
|
||||
}
|
||||
}
|
||||
|
||||
antoraContributions {
|
||||
'api' {
|
||||
catalogContent {
|
||||
from(aggregatedJavadoc) {
|
||||
into "java"
|
||||
}
|
||||
from(tasks.named("dokkatooGeneratePublicationHtml")) {
|
||||
into "kotlin"
|
||||
}
|
||||
}
|
||||
}
|
||||
from(runRemoteSpringApplicationExample) {
|
||||
into "modules/ROOT/examples"
|
||||
}
|
||||
from(documentDevtoolsPropertyDefaults) {
|
||||
into "modules/ROOT/partials/propertydefaults"
|
||||
}
|
||||
from(documentStarters) {
|
||||
into "modules/ROOT/partials/starters"
|
||||
}
|
||||
from(documentTestSlices) {
|
||||
into "modules/appendix/partials/slices"
|
||||
}
|
||||
from(runSpringApplicationExample) {
|
||||
into "modules/ROOT/partials/application"
|
||||
}
|
||||
from(runLoggingFormatExample) {
|
||||
into "modules/ROOT/partials/logging"
|
||||
}
|
||||
from(documentDependencyVersionCoordinates) {
|
||||
into "modules/appendix/partials/dependency-versions"
|
||||
}
|
||||
from(documentDependencyVersionProperties) {
|
||||
into "modules/appendix/partials/dependency-versions"
|
||||
}
|
||||
from(documentAutoConfigurationClasses) {
|
||||
into "modules/appendix/partials/auto-configuration-classes"
|
||||
}
|
||||
from(documentConfigurationProperties) {
|
||||
into "modules/appendix/partials/configuration-properties"
|
||||
}
|
||||
from(tasks.getByName("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
|
||||
def antoraApiCatalogContent = tasks.register("antoraApiCatalogContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "api-catalog-content"
|
||||
from(aggregatedJavadoc) {
|
||||
into "java"
|
||||
}
|
||||
from(tasks.named("dokkatooGeneratePublicationHtml")) {
|
||||
into "kotlin"
|
||||
}
|
||||
}
|
||||
|
||||
def copyAntoraContentDependencies = tasks.register("copyAntoraContentDependencies", Copy) {
|
||||
into layout.buildDirectory.dir('generated/docs/antora-dependencies-content')
|
||||
from(configurations.antoraContent)
|
||||
rename("spring-boot-actuator-autoconfigure", "spring-boot-docs")
|
||||
rename("spring-boot-maven-plugin", "spring-boot-docs")
|
||||
rename("spring-boot-gradle-plugin", "spring-boot-docs")
|
||||
}
|
||||
|
||||
tasks.named("antora") {
|
||||
inputs.files(antoraRootAggregateContent, antoraApiCatalogContent, copyAntoraContentDependencies)
|
||||
}
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
def mavenPublication = publishing.publications.getByName("maven");
|
||||
configurations.antoraContent.dependencies.forEach { dependency ->
|
||||
dependency.dependencyProject.configurations.getByName(dependency.targetConfiguration)
|
||||
.artifacts.forEach(mavenPublication::artifact)
|
||||
'root' {
|
||||
aggregateContent {
|
||||
from("src/main") {
|
||||
into "modules/ROOT/examples"
|
||||
}
|
||||
from(project.configurations.configurationProperties) {
|
||||
eachFile {
|
||||
it.path = rootProject
|
||||
.projectDir
|
||||
.toPath()
|
||||
.relativize(it.file.toPath())
|
||||
.toString()
|
||||
.replace('\\', '/')
|
||||
.replaceAll('.*/([^/]+)/build.*', 'modules/ROOT/partials/$1/spring-configuration-metadata.json')
|
||||
}
|
||||
}
|
||||
from(runRemoteSpringApplicationExample) {
|
||||
into "modules/ROOT/examples"
|
||||
}
|
||||
from(documentDevtoolsPropertyDefaults) {
|
||||
into "modules/ROOT/partials/propertydefaults"
|
||||
}
|
||||
from(documentStarters) {
|
||||
into "modules/ROOT/partials/starters"
|
||||
}
|
||||
from(documentTestSlices) {
|
||||
into "modules/appendix/partials/slices"
|
||||
}
|
||||
from(runSpringApplicationExample) {
|
||||
into "modules/ROOT/partials/application"
|
||||
}
|
||||
from(runLoggingFormatExample) {
|
||||
into "modules/ROOT/partials/logging"
|
||||
}
|
||||
from(documentDependencyVersionCoordinates) {
|
||||
into "modules/appendix/partials/dependency-versions"
|
||||
}
|
||||
from(documentDependencyVersionProperties) {
|
||||
into "modules/appendix/partials/dependency-versions"
|
||||
}
|
||||
from(documentAutoConfigurationClasses) {
|
||||
into "modules/appendix/partials/auto-configuration-classes"
|
||||
}
|
||||
from(documentConfigurationProperties) {
|
||||
into "modules/appendix/partials/configuration-properties"
|
||||
}
|
||||
from(tasks.getByName("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,12 +393,3 @@ dokkatoo {
|
||||
includes.from("src/docs/dokkatoo/dokka-overview.md")
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
getByName("maven") {
|
||||
artifact antoraRootAggregateContent
|
||||
artifact antoraApiCatalogContent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.gradle.plugins.ide.eclipse.model.Library
|
||||
plugins {
|
||||
id "java-gradle-plugin"
|
||||
id "maven-publish"
|
||||
id "org.antora"
|
||||
id "org.springframework.boot.antora-contributor"
|
||||
id "org.springframework.boot.docker-test"
|
||||
id "org.springframework.boot.maven-repository"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
@@ -14,7 +14,6 @@ plugins {
|
||||
description = "Spring Boot Gradle Plugins"
|
||||
|
||||
configurations {
|
||||
antoraContent
|
||||
"testCompileClasspath" {
|
||||
// Downgrade SLF4J is required for tests to run in Eclipse
|
||||
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36")
|
||||
@@ -166,35 +165,25 @@ javadoc {
|
||||
}
|
||||
}
|
||||
|
||||
def antoraGradlePluginLocalAggregateContent = tasks.register("antoraGradlePluginLocalAggregateContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "gradle-plugin-local-aggregate-content"
|
||||
from(tasks.getByName("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
|
||||
def antoraGradlePluginCatalogContent = tasks.register("antoraGradlePluginCatalogContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "gradle-plugin-catalog-content"
|
||||
from(javadoc) {
|
||||
into "api/java"
|
||||
antoraContributions {
|
||||
'gradle-plugin' {
|
||||
catalogContent {
|
||||
from(javadoc) {
|
||||
into("api/java")
|
||||
}
|
||||
}
|
||||
localAggregateContent {
|
||||
from(tasks.named("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
source()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("generateAntoraPlaybook") {
|
||||
xrefStubs = ["appendix:.*", "api:.*", "reference:.*"]
|
||||
excludeJavadocExtension = true
|
||||
alwaysInclude = [name: "gradle-plugin", classifier: "local-aggregate-content"]
|
||||
dependsOn antoraGradlePluginLocalAggregateContent
|
||||
}
|
||||
|
||||
tasks.named("antora") {
|
||||
inputs.files(antoraGradlePluginLocalAggregateContent, antoraGradlePluginCatalogContent)
|
||||
}
|
||||
|
||||
artifacts {
|
||||
antoraContent antoraGradlePluginCatalogContent
|
||||
antoraExtensions.xref.stubs = ["appendix:.*", "api:.*", "reference:.*"]
|
||||
asciidocExtensions.excludeJavadocExtension = true
|
||||
}
|
||||
|
||||
toolchain {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "org.antora"
|
||||
id "org.springframework.boot.antora-contributor"
|
||||
id "org.springframework.boot.maven-plugin"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
id "org.springframework.boot.docker-test"
|
||||
@@ -9,7 +9,6 @@ description = "Spring Boot Maven Plugin"
|
||||
|
||||
configurations {
|
||||
dependenciesBom
|
||||
antoraContent
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -148,45 +147,30 @@ tasks.named("documentPluginGoals") {
|
||||
]
|
||||
}
|
||||
|
||||
def antoraMavenPluginLocalAggregateContent = tasks.register("antoraMavenPluginLocalAggregateContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "maven-plugin-local-aggregate-content"
|
||||
from(tasks.getByName("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
|
||||
def antoraMavenPluginAggregateContent = tasks.register("antoraMavenPluginAggregateContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "maven-plugin-aggregate-content"
|
||||
from(documentPluginGoals) {
|
||||
into "modules/maven-plugin/partials/goals"
|
||||
}
|
||||
}
|
||||
|
||||
def antoraMavenPluginCatalogContent = tasks.register("antoraMavenPluginCatalogContent", Zip) {
|
||||
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
|
||||
archiveClassifier = "maven-plugin-catalog-content"
|
||||
from(javadoc) {
|
||||
into "api/java"
|
||||
antoraContributions {
|
||||
'maven-plugin' {
|
||||
aggregateContent {
|
||||
from(documentPluginGoals) {
|
||||
into "modules/maven-plugin/partials/goals"
|
||||
}
|
||||
}
|
||||
catalogContent {
|
||||
from(javadoc) {
|
||||
into "api/java"
|
||||
}
|
||||
}
|
||||
localAggregateContent {
|
||||
from(tasks.named("generateAntoraYml")) {
|
||||
into "modules"
|
||||
}
|
||||
}
|
||||
source()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("generateAntoraPlaybook") {
|
||||
xrefStubs = ["appendix:.*", "api:.*", "reference:.*", "how-to:.*"]
|
||||
excludeJavadocExtension = true
|
||||
alwaysInclude = [name: "maven-plugin", classifier: "local-aggregate-content"]
|
||||
dependsOn antoraMavenPluginLocalAggregateContent
|
||||
}
|
||||
|
||||
|
||||
tasks.named("antora") {
|
||||
inputs.files(antoraMavenPluginLocalAggregateContent, antoraMavenPluginAggregateContent, antoraMavenPluginCatalogContent)
|
||||
}
|
||||
|
||||
artifacts {
|
||||
antoraContent antoraMavenPluginAggregateContent
|
||||
antoraContent antoraMavenPluginCatalogContent
|
||||
antoraExtensions.xref.stubs = ["appendix:.*", "api:.*", "reference:.*", "how-to:.*"]
|
||||
asciidocExtensions.excludeJavadocExtension = true
|
||||
}
|
||||
|
||||
tasks.named("dockerTest").configure {
|
||||
|
||||
Reference in New Issue
Block a user