Skip to content

Commit

Permalink
Added a PDF task and updated docsZip
Browse files Browse the repository at this point in the history
I added a separate task for PDF generation, so that we can get good code formatting in the PDF. I also updated the docsZip task to pick up both the PDF output and the CSS and JS files (and images, if we ever have images in this project) that the HTML output needs.
  • Loading branch information
Jay Bryant committed Mar 4, 2019
1 parent 6906b00 commit 51d0ea8
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,27 @@ sonarqube {
}
}

task('makePDF', type: org.asciidoctor.gradle.AsciidoctorTask){
dependsOn prepareAsciidocBuild
backends 'pdf'
sourceDir "$buildDir/asciidoc/assemble"
outputDir = new File("$buildDir/docs")
sources {
include 'index.adoc'
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'docinfo': 'shared',
'icons': 'font',
'sectanchors': '',
'source-highlighter' : 'coderay',
'spring-ldap-version' : project.version,
revnumber : project.version
}

asciidoctor {
dependsOn prepareAsciidocBuild
backends 'html5', 'pdf'
dependsOn makePDF
backends 'html5'
sourceDir "$buildDir/asciidoc/assemble"
outputDir = new File("$buildDir/docs")
sources {
Expand All @@ -142,30 +160,11 @@ asciidoctor {
// use provided highlighter
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable'
'highlightjs-theme=atom-one-dark-reasonable',
'spring-ldap-version' : project.version,
revnumber : project.version
}


/* asciidoctor {
outputDir = new File("$buildDir/docs")
options = [
eruby: 'erubis',
attributes: [
copycss : '',
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc2: '',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
'spring-ldap-version' : project.version,
revnumber : project.version
]
]
} */

task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
Expand Down Expand Up @@ -201,6 +200,11 @@ task docsZip(type: Zip, dependsOn: asciidoctor) {

from (new File(asciidoctor.outputDir, "html5")) {
include "*.html"
include 'images/*', 'css/**', 'js/**'
into "reference"
}
from (new File(asciidoctor.outputDir, "pdf")) {
include "*.pdf"
into "reference"
}
}
Expand Down

0 comments on commit 51d0ea8

Please sign in to comment.