1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--Arbortext, Inc., 1988-2010, v.4002-->
|
---|
3 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
|
---|
4 | "..\dtd\reference.dtd">
|
---|
5 | <?Pub Sty _display FontColor="red"?>
|
---|
6 | <?Pub Inc?>
|
---|
7 | <reference id="antscript" xml:lang="en-us">
|
---|
8 | <title>Ant tasks and scripts</title>
|
---|
9 | <shortdesc>This topic describes detailed Ant tasks and scripts.</shortdesc>
|
---|
10 | <refbody>
|
---|
11 | <section><p>The build process including pre-process can be called by using an Ant script. The most important
|
---|
12 | Ant scrip file is called <filepath>build.xml</filepath>, it defines and combines common
|
---|
13 | pre-processing and output transformation routines, as well as extension points that allow
|
---|
14 | DITA-OT Plug-ins to add to this common processing.</p></section>
|
---|
15 | <section> <title>Sample ant script</title> <p>These ant scripts are in <filepath>samples/ant_sample</filepath> directory. They are
|
---|
16 | simple and easy to learn. From these files, you can learn how to write your own Ant script
|
---|
17 | to build your own process.</p> <p>Here is a sample template for writing an Ant script that executes transformation to XHTML
|
---|
18 | in <filepath>samples/ant_samples</filepath>
|
---|
19 | directory:<codeblock><?xml version="1.0" encoding="UTF-8" ?>
|
---|
20 | <project name="@PROJECT.NAME@_xhtml" default="@DELIVERABLE.NAME@2xhtml" basedir=".">
|
---|
21 |
|
---|
22 | <property name="dita.dir" location="${basedir}/../.."/>
|
---|
23 |
|
---|
24 | <target name="@DELIVERABLE.NAME@2xhtml">
|
---|
25 | <ant antfile="${dita.dir}${file.separator}build.xml">
|
---|
26 | <!-- please refer to the toolkit's document for supported parameters, and
|
---|
27 | specify them base on your needs -->
|
---|
28 | <property name="args.input" location="@DITA.INPUT@"/>
|
---|
29 | <property name="output.dir" location="@OUTPUT.DIR@"/>
|
---|
30 | <property name="transtype" value="xhtml"/>
|
---|
31 | </ant>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | </project></codeblock></p><p>To use this template, modify the following
|
---|
35 | items:<ul>
|
---|
36 | <li>Replace <codeph>@PROJECT.NAME@</codeph> with the name of your
|
---|
37 | project, such as "MyDocs".</li>
|
---|
38 | <li>Replace <codeph>@DELIVERABLE.NAME@</codeph> with the name of your
|
---|
39 | deliverable, such as "installDocs".</li>
|
---|
40 | <li>Replace <codeph>@DITA.INPUT@</codeph> with the name of your input
|
---|
41 | file (using either a full path or a relative path from the location
|
---|
42 | of this template).</li>
|
---|
43 | <li>Replace <codeph>@OUTPUT.DIR@</codeph> with the desired output
|
---|
44 | directory (using either a full path or a relative path from the location
|
---|
45 | of this template).</li>
|
---|
46 | </ul></p><p>Once you have updated these items, you can run your build
|
---|
47 | with the following command:<codeblock>ant -f samples/ant_sample/template_xhtml.xml</codeblock></p><p>The build will convert your input file to XHTML. Note that the build directly calls the Ant
|
---|
48 | script <filepath>build.xml</filepath>, which is a common entry point for DITA-OT builds; it
|
---|
49 | in turn imports all of the scripts mentioned above.</p></section>
|
---|
50 | </refbody>
|
---|
51 | <related-links>
|
---|
52 | <link href="dita-ot_ant_properties.dita"/>
|
---|
53 | </related-links>
|
---|
54 | </reference>
|
---|
55 | <?Pub *0000024648?>
|
---|