Rework Antora Gradle Infrastructure
Closes gh-40572 Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user