Skip to content

Commit

Permalink
get rid of Gradle warnings with '<<' tasks
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
ar committed Mar 2, 2017
1 parent 9d23623 commit be65c13
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ task copyWebResources(type: Sync) {
into "${buildDir}/docbook/html/"
}

task a2x(dependsOn: copySources) << {
task a2x(dependsOn: copySources) {
doLast {
def inFile = "${buildDir}/docbook/source/book.adoc"
def outFile = "${buildDir}/docbook/source/book.xml"
def cmd = "asciidoctor --safe -a docinfo -a lang=en -d book -b docbook5 -o ${outFile} ${inFile}"
def proc = cmd.execute(null, file(inFile).parentFile)
proc.in.eachLine { line -> println line }
proc.err.eachLine {line -> println 'ERROR: '+line }
proc.waitFor()
}
}

task createPdf(type: DocbookPdf) {
Expand All @@ -48,13 +50,17 @@ task createHtml(type: DocbookHtml) {
stylesheet "${projectDir}/src/xslt/html.xsl" as File
}

task viewHtml (dependsOn: createHtml, description: 'Open HTML docbook outout in default browser') << {
task viewHtml (dependsOn: createHtml, description: 'Open HTML docbook outout in default browser') {
doLast {
Class.forName("java.awt.Desktop").newInstance().browse(
new File("${buildDir}/docbook/html", 'book.html').toURI())
}
}

task viewPdf (dependsOn: createPdf , description: 'Open PDF docbook outout in default viewer') << {
task viewPdf (dependsOn: createPdf , description: 'Open PDF docbook outout in default viewer') {
doLast {
Class.forName("java.awt.Desktop").newInstance().browse(
new File("${buildDir}/docbook/pdf", this.project.rootProject.name + '.pdf').toURI())
}
}

0 comments on commit be65c13

Please # to comment.