Skip to content

Commit

Permalink
Merge pull request #103 from ndw/master
Browse files Browse the repository at this point in the history
Upgrade to gradle plugin 1.3.3 and fix option handling
  • Loading branch information
ndw authored Mar 5, 2018
2 parents ba036ee + b6868fc commit fd13d35
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 13 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
classpath fileTree(dir: 'lib').include("*.jar")
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.4'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: xmlCalabashVersion
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.2'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.3'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-deltaxml', version: '1.1.4'
classpath group: 'org.docbook', name: 'docbook-xsl-java-saxon', version: '1.2.1-95'
classpath group: 'org.docbook', name: 'docbook-schemas', version: '5.1-1'
Expand Down Expand Up @@ -59,9 +59,9 @@ dependencies {
[group: 'com.thaiopensource', name: 'jing', version: '20091111', transitive: false],
[group: 'org.docbook', name: 'docbook-xsl-java-saxon', version: '1.2.1-95'],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: xmlCalabashVersion],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.2'],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.3'],

// 1.2 because that's what gradleApi requires :-(
// 1.2 because that's what gradleApi requires :-(
[group: 'commons-cli', name: 'commons-cli', version: '1.2']
)

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.2.0
version=2.2.1
saxonVersion=9.8.0-8
xmlCalabashVersion=1.1.18-98

Expand Down
44 changes: 35 additions & 9 deletions src/main/groovy/org/docbook/DocBookTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,41 @@ class DocBookTask extends XMLCalabashTask {
logger.debug("DocBookTask did not find org.docbook.Schemas class");
}

pipelineURI = "https://cdn.docbook.org/release/latest/xslt/base/pipelines/docbook.xpl"

userArgs.addOption("format", getFormat())
userArgs.addOption("style", getStyle())
userArgs.addOption("preprocess", getPreprocess())
userArgs.addOption("postprocess", getPostprocess())
userArgs.addOption("return-secondary", getReturnSecondary())
userArgs.addOption("pdf", getPdf())
userArgs.addOption("css", getCss())
// The options in the build.gradle file are evaluated before we get called.
// Don't attempt to overwrite anything that's already been set.

if (pipelineURI == null) {
pipelineURI = "https://cdn.docbook.org/release/latest/xslt/base/pipelines/docbook.xpl"
}

if (!seenOptions.containsKey("format")) {
option("format", getFormat())
}

if (!seenOptions.containsKey("style")) {
option("style", getStyle())
}

if (!seenOptions.containsKey("preprocess")) {
option("preprocess", getPreprocess())
}

if (!seenOptions.containsKey("postprocess")) {
option("postprocess", getPostprocess())
}

if (!seenOptions.containsKey("return-secondary")) {
option("return-secondary", getReturnSecondary())
}

if (!seenOptions.containsKey("pdf")) {
option("pdf", getPdf())
}

if (!seenOptions.containsKey("css")) {
option("css", getCss())
}

super.setupRuntime()

if (schemaCatalog != null) {
Expand Down

0 comments on commit fd13d35

Please sign in to comment.