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 {
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.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 'de.undercouch.download' version '4.0.0'
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 {
publications {
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"
*/
@ -93,11 +101,21 @@ task extractDocResources(type: Copy, dependsOn: downloadResources) {
into "$buildDir/docs/spring-docs-resources/"
}
asciidoctorj {
modules {
pdf {
version '1.5.0-beta.8'
}
}
}
/**
* Produce the Spring Framework Reference documentation
* from "src/docs/asciidoc" into "build/asciidoc/html5"
*/
asciidoctor {
baseDirFollowsSourceDir()
configurations 'asciidoctorExt'
sources {
include '*.adoc'
}
@ -106,13 +124,15 @@ asciidoctor {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
from "$buildDir/docs/spring-docs-resources/"
from extractDocResources
}
logDocuments = true
backends = ["html5"]
// only ouput PDF documentation for non-SNAPSHOT builds
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
backends += "pdf"
outputOptions {
backends = ["html5"]
// only ouput PDF documentation for non-SNAPSHOT builds
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
backends += "pdf"
}
}
options doctype: 'book', eruby: 'erubis'
attributes([
@ -132,8 +152,6 @@ asciidoctor {
])
}
asciidoctor.dependsOn extractDocResources
/**
* Zip all docs (API and reference) into a single archive
*/