Always configure PDF backend as task will only run on cache miss

Previously, the Asciidoctor task was not cacheable and generating the
PDF documentation was very slow. To improve build times, the PDF
documentation was not generated for snapshot builds.

The upgrade to 2.4.0 of the Asciidoctor Gradle pluging means that the
Asciidoctor task is now cacheable. As such, its tasks will only run
when the documentation has changed. This should allow PDF
documentation to be published for every build without slowing things
down too much and the cost of generating the documentation will only
be incurred when there is a change to the documentation.

See gh-24216
This commit is contained in:
Andy Wilkinson 2019-12-16 09:15:46 +00:00 committed by Sam Brannen
parent 2ac5744323
commit 1ec15ba9c2
1 changed files with 1 additions and 5 deletions

View File

@ -128,11 +128,7 @@ asciidoctor {
}
logDocuments = true
outputOptions {
backends = ["html5"]
// only ouput PDF documentation for non-SNAPSHOT builds
if (!project.getVersion().toString().contains("BUILD-SNAPSHOT")) {
backends += "pdf"
}
backends = ["html5", "pdf"]
}
options doctype: 'book', eruby: 'erubis'
attributes([