Skip to content

Commit 2ac5744

Browse files
wilkinsonasbrannen
authored andcommitted
Upgrade to Asciidoctor Gradle Plugin 2.4
This commit updates the build to use the latest version of the Asciidoctor Gradle Plugin. One significant new feature is that the plugin's tasks are now cacheable. Closes gh-24216
1 parent c39ed52 commit 2ac5744

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

build.gradle

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
buildscript {
2-
dependencies {
3-
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
4-
classpath 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE'
5-
}
6-
}
7-
81
plugins {
92
id 'io.spring.dependency-management' version '1.0.8.RELEASE' apply false
103
id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false
114
id 'org.jetbrains.dokka' version '0.9.18' apply false
12-
id 'org.asciidoctor.convert' version '1.5.8'
5+
id 'org.asciidoctor.jvm.convert' version '2.4.0'
136
id 'io.spring.nohttp' version '0.0.4.RELEASE'
147
id 'de.undercouch.download' version '4.0.0'
158
id 'com.gradle.build-scan' version '3.1.1'
@@ -413,10 +406,6 @@ configure(rootProject) {
413406
}
414407
}
415408

416-
dependencies {
417-
asciidoctor("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
418-
}
419-
420409
publishing {
421410
publications {
422411
mavenJava(MavenPublication) {

gradle/docs.gradle

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
configurations {
2+
asciidoctorExt
3+
}
4+
5+
dependencies {
6+
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions:0.2.0.RELEASE")
7+
}
8+
19
/**
210
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
311
*/
@@ -93,11 +101,21 @@ task extractDocResources(type: Copy, dependsOn: downloadResources) {
93101
into "$buildDir/docs/spring-docs-resources/"
94102
}
95103

104+
asciidoctorj {
105+
modules {
106+
pdf {
107+
version '1.5.0-beta.8'
108+
}
109+
}
110+
}
111+
96112
/**
97113
* Produce the Spring Framework Reference documentation
98114
* from "src/docs/asciidoc" into "build/asciidoc/html5"
99115
*/
100116
asciidoctor {
117+
baseDirFollowsSourceDir()
118+
configurations 'asciidoctorExt'
101119
sources {
102120
include '*.adoc'
103121
}
@@ -106,13 +124,15 @@ asciidoctor {
106124
from(sourceDir) {
107125
include 'images/*', 'css/**', 'js/**'
108126
}
109-
from "$buildDir/docs/spring-docs-resources/"
127+
from extractDocResources
110128
}
111129
logDocuments = true
112-
backends = ["html5"]
113-
// only ouput PDF documentation for non-SNAPSHOT builds
114-
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
115-
backends += "pdf"
130+
outputOptions {
131+
backends = ["html5"]
132+
// only ouput PDF documentation for non-SNAPSHOT builds
133+
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
134+
backends += "pdf"
135+
}
116136
}
117137
options doctype: 'book', eruby: 'erubis'
118138
attributes([
@@ -132,8 +152,6 @@ asciidoctor {
132152
])
133153
}
134154

135-
asciidoctor.dependsOn extractDocResources
136-
137155
/**
138156
* Zip all docs (API and reference) into a single archive
139157
*/

0 commit comments

Comments
 (0)