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

+25-47
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+
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
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

+1-1
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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// tag::apply[]
22
plugins {
33
id 'java'
4-
id 'org.springframework.boot' version '{gradle-project-version}'
4+
id 'org.springframework.boot' version '{version-spring-boot}'
55
}
66

77
apply plugin: 'io.spring.dependency-management'

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/getting-started/typical-plugins.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// tag::apply[]
22
plugins {
33
java
4-
id("org.springframework.boot") version "{gradle-project-version}"
4+
id("org.springframework.boot") version "{version-spring-boot}"
55
}
66

77
apply(plugin = "io.spring.dependency-management")
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::additional[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
// tag::additional[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/integrating-with-actuator/build-info-basic.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::build-info[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
// tag::build-info[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::custom-values[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
// tag::custom-values[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::exclude-time[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
// tag::exclude-time[]
+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
33
// tag::configure-bom[]
44
plugins {
55
java
6-
id("org.springframework.boot") version "{gradle-project-version}" apply false
7-
id("io.spring.dependency-management") version "{dependency-management-plugin-version}"
6+
id("org.springframework.boot") version "{version-spring-boot}" apply false
7+
id("io.spring.dependency-management") version "{version-dependency-management-plugin}"
88
}
99

1010
dependencyManagement {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::configure-bom[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-bom.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
22

33
plugins {
44
java
5-
id("org.springframework.boot") version "{gradle-project-version}"
5+
id("org.springframework.boot") version "{version-spring-boot}"
66
}
77

88
// tag::configure-bom[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-platform.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/configure-platform.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
// tag::configure-platform[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
// tag::configure-platform[]
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
dependencies {
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
dependencies {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'org.springframework.boot' version '{gradle-project-version}'
2+
id 'org.springframework.boot' version '{version-spring-boot}'
33
}
44

55
apply plugin: 'io.spring.dependency-management'

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/custom-version.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
22

33
plugins {
4-
id("org.springframework.boot") version "{gradle-project-version}"
4+
id("org.springframework.boot") version "{version-spring-boot}"
55
}
66

77
apply(plugin = "io.spring.dependency-management")
+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ 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
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id 'org.springframework.boot' version '{version-spring-boot}' apply false
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id("org.springframework.boot") version "{version-spring-boot}" apply false
3+
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ 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
}

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
apply plugin: 'io.spring.dependency-management'

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/managing-dependencies/dependencies.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
java
3-
id("org.springframework.boot") version "{gradle-project-version}"
3+
id("org.springframework.boot") version "{version-spring-boot}"
44
}
55

66
apply(plugin = "io.spring.dependency-management")

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java'
33
id 'application'
4-
id 'org.springframework.boot' version '{gradle-project-version}'
4+
id 'org.springframework.boot' version '{version-spring-boot}'
55
}
66

77
// tag::main-class[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/application-plugin-main-class.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
java
33
application
4-
id("org.springframework.boot") version "{gradle-project-version}"
4+
id("org.springframework.boot") version "{version-spring-boot}"
55
}
66

77
// tag::main-class[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
tasks.named("bootJar") {

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-bind-caches.gradle.kts renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
22

33
plugins {
44
java
5-
id("org.springframework.boot") version "{gradle-project-version}"
5+
id("org.springframework.boot") version "{version-spring-boot}"
66
}
77

88
// tag::caches[]

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle renamed to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-builder.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '{gradle-project-version}'
3+
id 'org.springframework.boot' version '{version-spring-boot}'
44
}
55

66
tasks.named("bootJar") {

0 commit comments

Comments
 (0)