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
This commit is contained in:
Andy Wilkinson 2019-12-16 09:03:40 +00:00 committed by Sam Brannen
parent c39ed52f97
commit 2ac5744323
2 changed files with 26 additions and 19 deletions

View File

@ -1,15 +1,8 @@
buildscript {
dependencies {
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
classpath 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE'
}
}
plugins { plugins {
id 'io.spring.dependency-management' version '1.0.8.RELEASE' apply false id 'io.spring.dependency-management' version '1.0.8.RELEASE' apply false
id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false id 'org.jetbrains.kotlin.jvm' version '1.3.61' apply false
id 'org.jetbrains.dokka' version '0.9.18' apply false id 'org.jetbrains.dokka' version '0.9.18' apply false
id 'org.asciidoctor.convert' version '1.5.8' id 'org.asciidoctor.jvm.convert' version '2.4.0'
id 'io.spring.nohttp' version '0.0.4.RELEASE' id 'io.spring.nohttp' version '0.0.4.RELEASE'
id 'de.undercouch.download' version '4.0.0' id 'de.undercouch.download' version '4.0.0'
id 'com.gradle.build-scan' version '3.1.1' id 'com.gradle.build-scan' version '3.1.1'
@ -413,10 +406,6 @@ configure(rootProject) {
} }
} }
dependencies {
asciidoctor("io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.3.RELEASE")
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {

View File

@ -1,3 +1,11 @@
configurations {
asciidoctorExt
}
dependencies {
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions:0.2.0.RELEASE")
}
/** /**
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc" * Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
*/ */
@ -93,11 +101,21 @@ task extractDocResources(type: Copy, dependsOn: downloadResources) {
into "$buildDir/docs/spring-docs-resources/" into "$buildDir/docs/spring-docs-resources/"
} }
asciidoctorj {
modules {
pdf {
version '1.5.0-beta.8'
}
}
}
/** /**
* Produce the Spring Framework Reference documentation * Produce the Spring Framework Reference documentation
* from "src/docs/asciidoc" into "build/asciidoc/html5" * from "src/docs/asciidoc" into "build/asciidoc/html5"
*/ */
asciidoctor { asciidoctor {
baseDirFollowsSourceDir()
configurations 'asciidoctorExt'
sources { sources {
include '*.adoc' include '*.adoc'
} }
@ -106,14 +124,16 @@ asciidoctor {
from(sourceDir) { from(sourceDir) {
include 'images/*', 'css/**', 'js/**' include 'images/*', 'css/**', 'js/**'
} }
from "$buildDir/docs/spring-docs-resources/" from extractDocResources
} }
logDocuments = true logDocuments = true
outputOptions {
backends = ["html5"] backends = ["html5"]
// only ouput PDF documentation for non-SNAPSHOT builds // only ouput PDF documentation for non-SNAPSHOT builds
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) { if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
backends += "pdf" backends += "pdf"
} }
}
options doctype: 'book', eruby: 'erubis' options doctype: 'book', eruby: 'erubis'
attributes([ attributes([
icons: 'font', icons: 'font',
@ -132,8 +152,6 @@ asciidoctor {
]) ])
} }
asciidoctor.dependsOn extractDocResources
/** /**
* Zip all docs (API and reference) into a single archive * Zip all docs (API and reference) into a single archive
*/ */