Last active
August 29, 2015 14:05
-
-
Save eerohele/0cb870824b51eb501cc5 to your computer and use it in GitHub Desktop.
A minimal Gradle buildfile for running a DITA-OT transformation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultTasks 'ditaOt' | |
def ditaHome = System.env.DITA_HOME | |
def antHome = System.env.ANT_HOME | |
task ditaOt << { | |
ant.java(classname: "org.apache.tools.ant.launch.Launcher", fork: "true", failonerror: "true") { | |
ant.jvmarg(value: "-Dant.library.dir=${antHome}/lib") | |
ant.classpath { | |
ant.pathelement(location: "${antHome}/lib/ant-launcher.jar") | |
} | |
ant.arg(line: "-lib ${ditaHome}") | |
ant.arg(line: "-lib ${ditaHome}/lib") | |
// For DITA-OT < 2.0 | |
ant.arg(line: "-lib ${ditaHome}/lib/saxon") | |
// For DITA-OT < 1.6 | |
ant.arg(line: "-lib ${ditaHome}/demo/fo/fop/lib") | |
ant.arg(line: "-buildfile ${ditaHome}/build.xml") | |
// Properties passed to DITA-OT transformation | |
ant.sysproperty(key: "transtype", value: "xhtml") | |
ant.sysproperty(key: "args.input", value: "${inputFile}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment