2008-11-09
■ DocBookのApache Antビルドファイル
分割がうまくいかなくて悩み中。
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Author: cocelo <cocelo@gmail.com>
-->
<project name="docbook-src" default="usage">
<description>
This Ant build.xml file is used to transform DocBook XML to various
</description>
<!--
- Configure basic properties that will be used in the file.
-->
<property name="docbook.xsl.dir" value="C:\Programs\Eclipse\ClassPath\docbook-xsl-ns-1.74.0" />
<property name="doc.dir" value="doc" />
<property name="html.stylesheet" value="${docbook.xsl.dir}/xhtml-1_1/docbook.xsl" />
<property name="xalan.lib.dir" value="C:\Programs\Eclipse\ClassPath\xalan-j_2_7_1" />
<!--
- Sets up the classpath for the Xalan and Xerces implementations
- that are to be used in this script, since the versions that ship
- with Ant may be out of date.
-->
<path id="xalan.classpath">
<fileset dir="${xalan.lib.dir}" id="xalan.fileset">
<include name="xalan.jar" />
<include name="xercesImpl.jar" />
</fileset>
</path>
<!--
- target: usage
-->
<target name="usage" description="Prints the Ant build.xml usage">
<echo message="Use -projecthelp to get a list of the available targets." />
</target>
<!--
- target: clean
-->
<target name="clean" description="Cleans up generated files.">
<delete dir="${doc.dir}" />
</target>
<!--
- target: depends
-->
<target name="depends">
<mkdir dir="${doc.dir}" />
</target>
<!--
- target: build-html
- description: Iterates through a directory and transforms
- .xml files into .html files using the DocBook XSL.
-->
<target name="build-html" depends="depends" description="Generates HTML files from DocBook XML">
<xslt style="${html.stylesheet}" extension=".html" basedir="src" destdir="${doc.dir}">
<classpath refid="xalan.classpath" />
<outputproperty name="encoding" value="UTF-8"/>
<outputproperty name="indent" value="yes"/>
<param name="html.stylesheet" expression="style.css" />
</xslt>
<!-- Copy the stylesheet to the same directory as the HTML files -->
<copy todir="${doc.dir}">
<fileset dir="src">
<include name="style.css" />
</fileset>
</copy>
</target>
</project>