Skip to content

Commit 18a2b2e

Browse files
committed
Migrate gradle-pluigin to Antora
See gh-33766
1 parent f35d6b6 commit 18a2b2e

File tree

139 files changed

+1057
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+1057
-790
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java-gradle-plugin"
33
id "maven-publish"
4-
id "org.asciidoctor.jvm.convert"
4+
id "org.antora"
55
id "org.springframework.boot.conventions"
66
id "org.springframework.boot.maven-repository"
77
id "org.springframework.boot.optional-dependencies"
@@ -10,7 +10,7 @@ plugins {
1010
description = "Spring Boot Gradle Plugins"
1111

1212
configurations {
13-
documentation
13+
antoraContent
1414
"testCompileClasspath" {
1515
// Downgrade SLF4J is required for tests to run in Eclipse
1616
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36")
@@ -34,8 +34,6 @@ configurations {
3434
}
3535

3636
dependencies {
37-
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
38-
3937
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
4038
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
4139
implementation("io.spring.gradle:dependency-management-plugin")
@@ -86,36 +84,8 @@ validatePlugins {
8684
enableStricterValidation = true
8785
}
8886

89-
task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) {
90-
enforcedPlatform(":spring-boot-project:spring-boot-dependencies")
91-
}
92-
93-
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
94-
dependsOn dependencyVersions
95-
inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
96-
doFirst {
97-
attributes "dependency-management-plugin-version": dependencyVersions.versionConstraints["io.spring.gradle:dependency-management-plugin"]
98-
}
99-
}
100-
10187
tasks.named('test') {
102-
inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
103-
}
104-
105-
asciidoctor {
106-
sources {
107-
include "index.adoc"
108-
}
109-
}
110-
111-
task asciidoctorPdf(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) {
112-
sources {
113-
include "index.adoc"
114-
}
115-
}
116-
117-
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
118-
attributes "native-build-tools-version": nativeBuildToolsVersion
88+
inputs.dir('src/docs/antora/modules/gradle-plugin/examples').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
11989
}
12090

12191
javadoc {
@@ -133,25 +103,33 @@ javadoc {
133103
}
134104
}
135105

136-
task zip(type: Zip) {
137-
dependsOn asciidoctor, asciidoctorPdf
138-
duplicatesStrategy "fail"
139-
from(asciidoctorPdf.outputDir) {
140-
into "reference/pdf"
141-
rename "index.pdf", "${project.name}-reference.pdf"
142-
}
143-
from(asciidoctor.outputDir) {
144-
into "reference/htmlsingle"
106+
def antoraGradlePluginLocalAggregateContent = tasks.register("antoraGradlePluginLocalAggregateContent", Zip) {
107+
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
108+
archiveClassifier = "gradle-plugin-local-aggregate-content"
109+
from(tasks.getByName("generateAntoraYml")) {
110+
into "modules"
145111
}
112+
}
113+
114+
def antoraGradlePluginCatalogContent = tasks.register("antoraGradlePluginCatalogContent", Zip) {
115+
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
116+
archiveClassifier = "gradle-plugin-catalog-content"
146117
from(javadoc) {
147-
into "api"
118+
into "api/java"
148119
}
149120
}
150121

151-
artifacts {
152-
"documentation" zip
122+
tasks.named("generateAntoraPlaybook") {
123+
xrefStubs = ["appendix:.*", "api:.*", "reference:.*"]
124+
alwaysInclude = [name: "gradle-plugin", classifier: "local-aggregate-content"]
125+
dependsOn antoraGradlePluginLocalAggregateContent
153126
}
154127

155-
toolchain {
156-
maximumCompatibleJavaVersion = JavaLanguageVersion.of(20)
128+
tasks.named("antora") {
129+
inputs.files(antoraGradlePluginLocalAggregateContent, antoraGradlePluginCatalogContent)
157130
}
131+
132+
artifacts {
133+
antoraContent antoraGradlePluginCatalogContent
134+
}
135+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: spring-boot
2+
ext:
3+
zip_contents_collector:
4+
include:
5+
- name: gradle-plugin
6+
classifier: catalog-content
7+
module: gradle-plugin
8+
destination: content-catalog
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugins {
2+
id 'org.springframework.boot' version '{version-spring-boot}'
3+
id 'org.graalvm.buildtools.native' version '{version-native-build-tools}'
4+
id 'java'
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugins {
2+
id("org.springframework.boot") version "{version-spring-boot}"
3+
id("org.graalvm.buildtools.native") version "{version-native-build-tools}"
4+
java
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id 'org.springframework.boot' version '{version-spring-boot}'
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id("org.springframework.boot") version "{version-spring-boot}"
3+
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/apply-plugin-snapshot.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'org.springframework.boot:spring-boot-gradle-plugin:{gradle-project-version}'
7+
classpath 'org.springframework.boot:spring-boot-gradle-plugin:{version-spring-boot}'
88
}
99
}
1010

0 commit comments

Comments
 (0)