Rework Antora Gradle Infrastructure

Closes gh-40572

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
This commit is contained in:
Andy Wilkinson
2024-10-31 17:36:51 +00:00
parent 6470748d6d
commit f9281a61ff
21 changed files with 1135 additions and 290 deletions

View File

@@ -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 {