<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2010, v.4002-->
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
 "..\dtd\reference.dtd">
<?Pub Sty _display FontColor="red"?>
<?Pub Inc?>
<reference id="antscript" xml:lang="en-us">
<title>Ant tasks and scripts</title>
<shortdesc>This topic describes detailed Ant tasks and scripts.</shortdesc>
<refbody>
<section><p>The build process including pre-process can be called by using an Ant script. The most important
        Ant scrip file is called <filepath>build.xml</filepath>, it defines and combines common
        pre-processing and output transformation routines, as well as extension points that allow
        DITA-OT Plug-ins to add to this common processing.</p></section>
<section>       <title>Sample ant script</title>       <p>These ant scripts are in <filepath>samples/ant_sample</filepath> directory. They are
        simple and easy to learn. From these files, you can learn how to write your own Ant script
        to build your own process.</p>       <p>Here is a sample template for writing an Ant script that executes transformation to XHTML
        in <filepath>samples/ant_samples</filepath>
        directory:<codeblock>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;project name="@PROJECT.NAME@_xhtml" default="@DELIVERABLE.NAME@2xhtml" basedir=".">

  &lt;property name="dita.dir" location="${basedir}/../.."/>
 
  &lt;target name="@DELIVERABLE.NAME@2xhtml">
    &lt;ant antfile="${dita.dir}${file.separator}build.xml">
      &lt;!-- please refer to the toolkit's document for supported parameters, and 
           specify them base on your needs -->
      &lt;property name="args.input" location="@DITA.INPUT@"/>
      &lt;property name="output.dir" location="@OUTPUT.DIR@"/>
      &lt;property name="transtype" value="xhtml"/>
    &lt;/ant>
  &lt;/target>

&lt;/project></codeblock></p><p>To use this template, modify the following
items:<ul>
<li>Replace <codeph>@PROJECT.NAME@</codeph> with the name of your
project, such as "MyDocs".</li>
<li>Replace <codeph>@DELIVERABLE.NAME@</codeph> with the name of your
deliverable, such as "installDocs".</li>
<li>Replace <codeph>@DITA.INPUT@</codeph> with the name of your input
file (using either a full path or a relative path from the location
of this template).</li>
<li>Replace <codeph>@OUTPUT.DIR@</codeph> with the desired output
directory (using either a full path or a relative path from the location
of this template).</li>
</ul></p><p>Once you have updated these items, you can run your build
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
        script <filepath>build.xml</filepath>, which is a common entry point for DITA-OT builds; it
        in turn imports all of the scripts mentioned above.</p></section>
</refbody>
  <related-links>
    <link href="dita-ot_ant_properties.dita"/>
  </related-links>
</reference>
<?Pub *0000024648?>
