Building output with the dita command is often easier than using Ant. In particular, you can
use .properties files to specify sets of DITA-OT parameters for each build.
You can include the dita command in shell scripts to perform multiple builds.
In your Ant build file, identify the properties set in each build target.
Some build parameters might be specified as properties of the project as a whole. You can refer to a
build log to see a list of all properties that were set for the build.
Create a .properties file for each build and specify the needed build parameters, one
per line, in the format name = value.
Use the dita command to perform each build, referencing your
.properties file with the -propertyfile option.
Example: Ant build
Sample build file: dita-ot-dir/docsrc/samples/ant_sample/build-chm-pdf.xml
Example: .properties files with dita command
The following .properties files and dita commands are equivalent to the
example Ant build.
Sample .properties file: /properties/chm.properties
Sample .properties file: /properties/pdf.properties
Run from :
-input sequence.ditamap -format htmlhelp -propertyfile properties/chm.properties
-input taskbook.ditamap -format pdf -propertyfile properties/pdf.properties
Example: Call the dita command from an Ant build
In some cases, you might still want to use an Ant build to implement some pre- or post-processing steps, but
also want the convenience of using the dita command with .properties
files to define the parameters for each build. This can be accomplished with Ant's exec
task.
This example uses a dita-cmd Ant macro defined in the /ant_sample/dita-cmd.xml file.
Sample build file: /ant_sample/build-chm-pdf-hybrid.xml