<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="./etc/wfrant2html.xsl"?>
<!-- version 2005/08/22 -->
<!-- author Bill Rich, BillRich@attglobal.net, Wilandra Consulting LLC. Copyright (C) 2003-2005, Wilandra Consulting LLC. All rights reserved.

    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

		See http://g11ntoolkit.sourceforge.net/licenseGPL.html for the License Agreement.
-->

<project name="G11NToolKit" basedir="." default="all">
	<description>
		This build file will compile and package any or all of the G11NToolKit classes. The classes are divided into several packages. The packages contain classes that have some characteristics in common.
	</description>

<!-- =================================================================== -->
	<target name="init"
		description="Set up some stuff we need in the rest of the file including access to the system environment variables.">
		<!-- Set up the environment so we have access to environment variables. -->
		<property	environment="env"/>

   	<!-- The current year in case it is needed later. -->
    <tstamp>
      <format	property="year"
      				pattern="yyyy"/>
    </tstamp>

		<!-- A properties file that contains some stuff that can be easily changed. -->
		<property	file="build.properties"/>

		<!-- The distribution directory names for the various packages. -->
		<property	name="dist.name"					value="${name}-${version}"/>
		<property	name="dist.dir"						value="${dist.name}"/>
		<property	name="dist.bin"						value="${dist.dir}/bin"/>
		<property	name="dist.dev"						value="${dist.dir}/Design"/>
		<property	name="dist.dist"					value="${dist.dir}/dist"/>
		<property	name="dist.doc"						value="${dist.dir}/Doc"/>
		<property	name="dist.doc.javadoc"		value="${dist.doc}/classes"/>
		<property	name="dist.etc"						value="${dist.dir}/etc"/>
		<property	name="dist.ext"						value="${dist.dir}/extensions"/>
		<property	name="dist.ext.bin"				value="${dist.ext}/bin"/>
		<property	name="dist.ext.doc"				value="${dist.ext}/Doc"/>
		<property	name="dist.ext.etc"				value="${dist.ext}/etc"/>
		<property	name="dist.ext.lib"				value="${dist.ext}/lib"/>
		<property	name="dist.ext.proc"			value="${dist.ext}/L10NProcess"/>
		<property	name="dist.install"				value="${dist.dir}/install"/>
		<property	name="dist.lib"						value="${dist.dir}/lib"/>
		<property	name="dist.proc"					value="${dist.dir}/L10NProcess"/>
		<property	name="dist.src"						value="${dist.dir}/src"/>
		<property	name="dist.src.lib"				value="${dist.src}/lib"/>
		<property	name="dist.test"					value="${dist.dir}/test"/>

		<!-- The install directory name. -->
		<property	name="installed.dir"			value="${env.G11NTOOLKIT_DIR}"/>

		<!-- The source directory names for the various packages. -->
		<property name="src.antutil"				value="${pkg.base.dir}/antutil"/>
		<property	name="src.detokenizer"		value="${pkg.base.dir}/detokenizer"/>
		<property name="src.domutil"				value="${pkg.base.dir}/domutil"/>
		<property	name="src.levblock"				value="${pkg.base.dir}/levblock"/>
		<property	name="src.parser"					value="${pkg.base.dir}/parser"/>
		<property	name="src.parser.html"		value="${src.parser}/html"/>
		<property	name="src.parser.java"		value="${src.parser}/java"/>
		<property	name="src.parser.xml"			value="${src.parser}/xml"/>
		<property	name="src.project"				value="${pkg.base.dir}/project"/>
		<property	name="src.pseudoxlator"		value="${pkg.base.dir}/pseudoxlator"/>
		<property	name="src.resources"			value="${pkg.base.dir}/resources"/>
		<property	name="src.sorter"					value="${pkg.base.dir}/sorter"/>
		<property	name="src.strfile"				value="${pkg.base.dir}/strfile"/>
		<property	name="src.token"					value="${pkg.base.dir}/token"/>
		<property	name="src.tokenizer"			value="${pkg.base.dir}/tokenizer"/>
		<property	name="src.tokfile"				value="${pkg.base.dir}/tokfile"/>
		<property	name="src.util"						value="${pkg.base.dir}/util"/>
		<property	name="src.xlclassname"		value="${pkg.base.dir}/xlclassname"/>
		<property name="src.xliffutil"			value="${pkg.base.dir}/xliffutil"/>
		<property	name="src.lib"						value="${src.dir}/lib"/>

		<!-- The directory to contain the JavaDoc files for the class documentation. -->
		<property	name="doc.dir.javadoc"		value="${doc.dir}/classes"/>

		<!-- The directories that contain the extensions default files. There must be at least one file in each directory (the readme.html file is satisfactory). -->
		<property	name="ext.dir"						value="extensions"/>
		<property	name="ext.bin"						value="${ext.dir}/bin"/>
		<property	name="ext.doc"						value="${ext.dir}/Doc"/>
		<property	name="ext.etc"						value="${ext.dir}/etc"/>
		<property	name="ext.lib"						value="${ext.dir}/lib"/>
		<property	name="ext.proc"						value="${ext.dir}/L10NProcess"/>

		<!-- The build directory structure. Contains only the files that are a result of this build file. Can be deleted whenever needed and rebuilt with this file. -->
		<property	name="build.classes"			value="${build.dir}/classes"/>
		<property	name="build.pkg"					value="${build.classes}/${pkg.base.dir}"/>
		<property name="build.antutil"			value="${build.pkg}/antutil"/>
		<property	name="build.detokenizer"	value="${build.pkg}/detokenizer"/>
		<property name="build.domutil"			value="${build.pkg}/domutil"/>
		<property	name="build.levblock"			value="${build.pkg}/levblock"/>
		<property	name="build.parser"				value="${build.pkg}/parser"/>
		<property	name="build.parser.html"	value="${build.parser}/html"/>
		<property	name="build.parser.java"	value="${build.parser}/java"/>
		<property	name="build.parser.xml"		value="${build.parser}/xml"/>
		<property	name="build.project"			value="${build.pkg}/project"/>
		<property	name="build.pseudoxlator"	value="${build.pkg}/pseudoxlator"/>
		<property	name="build.resources"		value="${build.pkg}/resources"/>
		<property	name="build.sorter"				value="${build.pkg}/sorter"/>
		<property	name="build.strfile"			value="${build.pkg}/strfile"/>
		<property	name="build.token"				value="${build.pkg}/token"/>
		<property	name="build.tokenizer"		value="${build.pkg}/tokenizer"/>
		<property	name="build.tokfile"			value="${build.pkg}/tokfile"/>
		<property	name="build.util"					value="${build.pkg}/util"/>
		<property	name="build.xlclassname"	value="${build.pkg}/xlclassname"/>
		<property name="build.xliffutil"		value="${build.pkg}/xliffutil"/>
		<property	name="build.lib"					value="${build.dir}/lib"/>

		<!-- A class path for the JavaCC compiler. -->
		<path id="classpath.jcc">
			<fileset dir="${src.dir}/${src.parser.java}/javacc-3.2/bin/lib">
				<include name="**/*.jar"/>
			</fileset>
		</path>

		<!-- A class path for the CyberNeko parser package. -->
		<path id="classpath.cyberneko">
			<fileset dir="${src.dir}/${src.parser.html}/nekohtml-0.9.4">
				<include name="**/*.jar"/>
			</fileset>
		</path>

		<!-- A class path for Ant. -->
		<path id="classpath.ant">
			<fileset dir="${env.ANT_HOME}/lib">
				<include name="**/*.jar"/>
			</fileset>
		</path>

		<!-- A class path for the Java compiler. -->
		<path id="classpath.compile">
			<fileset dir="./${build.pkg}">
				<include name="**/*.class"/>
			</fileset>
			<fileset dir="./${src.lib}">
				<include name="**/*.jar"/>
				<include name="**/*.zip"/>
			</fileset>
			<pathelement location="."/>
		</path>

		<!-- A class path for the JavaDoc compiler. -->
		<path id="classpath.javadoc">
			<fileset dir="./${src.lib}">
				<include name="**/*.jar"/>
				<include name="**/*.zip"/>
			</fileset>
			<fileset dir="${env.ANT_HOME}/lib">
				<include name="**/*.jar"/>
			</fileset>
		</path>

	</target>

<!-- =================================================================== -->
	<target name="makebuilddir" depends="init"
		description="Makes the build directory if it is not already there.">
		<mkdir dir="${build.pkg}"/>
		<mkdir dir="${build.lib}"/>
	</target>

<!-- =================================================================== -->
	<target name="detokclean"
		depends="init"
		description="Clean out the Detokenizer build files.">
		<delete dir="${build.detokenizer}"/>
	</target>

<!-- =================================================================== -->
	<target name="detokcomp"
		depends="init, makebuilddir, strfilecomp, tokfilecomp, utilcomp, levblockcomp, tokencomp, tokcomp, projectcomp"
		description="Compile the Detokenizer classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.detokenizer}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="levblockclean"
		depends="init"
		description="Clean out the LevBlock build files.">
		<delete dir="${build.levblock}"/>
	</target>

<!-- =================================================================== -->
	<target name="levblockcomp"
		depends="init, makebuilddir, xmlparsercomp, utilcomp, tokencomp"
		description="Compile the LevBlock classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.levblock}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="htmlparserclean"
		depends="init"
		description="Clean out the HTML File Parser build files.">
		<delete dir="${build.parser.html}"/>
	</target>

<!-- =================================================================== -->
	<target name="htmlparsercomp"
		depends="init, makebuilddir"
		description="Compile the HTML File Parser classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.parser.html}/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="javaparserclean"
		depends="init"
		description="Clean out the Java File Parser build files.">
		<delete dir="${build.parser.java}"/>
		<delete dir="${src.dir}/${src.parser.java}/gen"/>
	</target>

<!-- =================================================================== -->
	<target name="javaparsercomp"
		depends="init, makebuilddir, jjcomp"
		description="Compile the Java Parser classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.parser.java}/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

	<target name="grammercheck"
		depends="init"
		description="Check for updates to the Java Grammer file.">
		<uptodate	property="grammerUpToDate"
							srcfile="${src.dir}/${src.parser.java}/java1.4.jjt"
							targetfile="${build.parser.java}/JavaParser.class"/>
	</target>

	<target name="jjtree"
		depends="grammercheck" unless="grammerUpToDate"
		description="Make the classes for the JavaCC Tree for the Java Language.">
		<mkdir dir="${src.dir}/${src.parser.java}/gen"/>
		<java	classname="jjtree"
					fork="true"
					failonerror="true">
			<classpath	refid="classpath.jcc"/>
			<arg	line="-OUTPUT_DIRECTORY=${src.dir}/${src.parser.java}/gen"/>
			<arg	line="${src.dir}/${src.parser.java}/java1.4.jjt"/>
		</java>
		<delete file="${src.dir}/${src.parser.java}/gen/SimpleNode.java"/>
	</target>

	<target name="jjcomp"
		depends="makebuilddir, grammercheck, jjtree"
		unless="grammerUpToDate"
		description="Make the classes for the JavaCC Grammar file generated by the jcctree target for the Java Language.">
		<java	classname="javacc"
					fork="true"
					failonerror="true">
			<classpath	refid="classpath.jcc"/>
			<arg	line="-OUTPUT_DIRECTORY=${src.dir}/${src.parser.java}/gen"/>
			<arg	line="${src.dir}/${src.parser.java}/gen/java1.4.jj"/>
		</java>
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}/${src.parser.java}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="*.java" />
			<include name="gen/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="xmlparserclean"
		depends="init"
		description="Clean out the XML File Parser build files.">
		<delete dir="${build.parser.xml}"/>
	</target>

<!-- =================================================================== -->
	<target name="xmlparsercomp"
		depends="init, makebuilddir"
		description="Compile the XML File Parser classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.parser.xml}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="projectclean"
		depends="init"
		description="Clean out the Project build files.">
		<delete dir="${build.project}"/>
	</target>

<!-- =================================================================== -->
	<target name="projectcomp"
		depends="init, makebuilddir"
		description="Compile the Project classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.project}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="pseudoxlatorclean"
		depends="init"
		description="Clean out the Pseudo-translator build files.">
		<delete dir="${build.pseudoxlator}"/>
	</target>

<!-- =================================================================== -->
	<target name="pseudoxlatorcomp"
		depends="init, makebuilddir"
		description="Compile the Pseudo-translator classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.pseudoxlator}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="resourcesclean"
		depends="init"
		description="Clean out the Resources build files.">
		<delete dir="${build.resources}"/>
	</target>

<!-- =================================================================== -->
	<target name="resourcescomp"
		depends="init, makebuilddir"
		description="Compile the Resources classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.resources}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="sorterclean"
		depends="init"
		description="Clean out the Sorter build files.">
		<delete dir="${build.sorter}"/>
	</target>

<!-- =================================================================== -->
	<target name="sortercomp"
		depends="init, makebuilddir"
		description="Compile the Sorter classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.sorter}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="strfileclean"
		depends="init"
		description="Clean out the StrFile build files.">
		<delete dir="${build.strfile}"/>
	</target>

<!-- =================================================================== -->
	<target name="strfilecomp"
		depends="init, makebuilddir, levblockcomp, xmlparsercomp, sortercomp, utilcomp, tokencomp, projectcomp, tokfilecomp"
		description="Compile the StrFile classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.strfile}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="tokenclean"
		depends="init"
		description="Clean out the Token build files.">
		<delete dir="${build.token}"/>
	</target>

<!-- =================================================================== -->
	<target name="tokencomp"
		depends="init, makebuilddir, xmlparsercomp"
		description="Compile the Token classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.token}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="tokclean"
		depends="init"
		description="Clean out the Tokenizer build files.">
		<delete dir="${build.tokenizer}"/>
	</target>

<!-- =================================================================== -->
	<target name="tokcomp"
		depends="init, makebuilddir, projectcomp, javaparsercomp"
		description="Compile the Tokenizer classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.tokenizer}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="tokfileclean"
		depends="init"
		description="Clean out the TokFile build files.">
		<delete dir="${build.tokfile}"/>
	</target>

<!-- =================================================================== -->
	<target name="tokfilecomp"
		depends="init, makebuilddir"
		description="Compile the TokFile classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.tokfile}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="utilclean"
		depends="init"
		description="Clean out the Util build files.">
		<delete dir="${build.util}"/>
	</target>

<!-- =================================================================== -->
	<target name="utilcomp"
		depends="init, makebuilddir"
		description="Compile the Util classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.util}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="xlclassnameclean"
		depends="init"
		description="Clean out the XlClassName build files.">
		<delete dir="${build.xlclassname}"/>
	</target>

<!-- =================================================================== -->
	<target name="xlclassnamecomp"
		depends="init, makebuilddir"
		description="Compile the XlClassName classes.">
		<javac	destdir="${build.classes}"
						srcdir="${src.dir}"
						debug="true"
						deprecation="true"
						source="1.4"
						sourcepath="">
			<include name="${src.xlclassname}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="antutilclean"
		depends="init"
		description="Clean out the antutil build files.">
		<delete dir="${build.antutil}"/>
	</target>

<!-- =================================================================== -->
	<target name="antutilcomp"
		depends="init, makebuilddir"
		description="Compile the antutil classes.">
		<javac destdir="${build.classes}" srcdir="${src.dir}" debug="true" deprecation="true" source="1.4" sourcepath="">
			<include name="${src.antutil}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="domutilclean"
		depends="init"
		description="Clean out the domutil build files.">
		<delete dir="${build.domutil}"/>
	</target>

<!-- =================================================================== -->
	<target name="domutilcomp"
		depends="init, makebuilddir"
		description="Compile the domutil classes.">
		<javac destdir="${build.classes}" srcdir="${src.dir}" debug="true" deprecation="true" source="1.4" sourcepath="">
			<include name="${src.domutil}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="xliffutilclean"
		depends="init"
		description="Clean out the xliffutil build files.">
		<delete dir="${build.xliffutil}"/>
	</target>

<!-- =================================================================== -->
	<target name="xliffutilcomp"
		depends="init, makebuilddir"
		description="Compile the xliffutil classes.">
		<javac destdir="${build.classes}" srcdir="${src.dir}" debug="true" deprecation="true" source="1.4" sourcepath="">
			<include name="${src.xliffutil}/**/*.java" />
			<classpath refid="classpath.compile"/>
		</javac>
	</target>

<!-- =================================================================== -->
	<target name="buildclean"
		depends="detokclean, domutilclean, htmlparserclean, javaparserclean, levblockclean, projectclean, pseudoxlatorclean, resourcesclean, sorterclean, strfileclean, tokclean, tokenclean, tokfileclean, utilclean, xlclassnameclean, xmlparserclean, antutilclean, xliffutilclean"
		description="Clean out all the build files.">
		<delete dir="${build.dir}"/>
	</target>

<!-- =================================================================== -->
	<target name="distclean"
		depends="init"
		description="Clean out all the distribution files.">
		<delete dir="${dist.dir}" failonerror="false"/>
	</target>

<!-- =================================================================== -->
	<target name="comp"
		depends="makebuilddir, detokcomp, domutilcomp, htmlparsercomp, javaparsercomp, levblockcomp, projectcomp, pseudoxlatorcomp, resourcescomp, sortercomp, strfilecomp, tokcomp, tokencomp, tokfilecomp, utilcomp, xlclassnamecomp, xmlparsercomp, antutilcomp, xliffutilcomp"
		description="Compile all the toolkit classes.">
	</target>

<!-- =================================================================== -->
	<target name="jar"
		depends="init, comp"
		description="Make the jar file for the G11NToolKit package.">
		<jar	jarfile="${build.lib}/${pkg.jar}"
					compress="true"
					basedir="./${build.classes}"
					includes="**/*.class">
		</jar>
	</target>

<!-- =================================================================== -->
	<target name="distlic"
		depends="init"
		description="Copy the license files, release notes, and road map to the distribution package staging area.">
		<copy	file="license.txt"
					todir="${dist.dir}"/>
		<copy	file="${doc.dir}/licenseGPL.html"
					todir="${dist.dir}"/>
		<copy	file="${doc.dir}/ReleaseNotes.html"
					todir="${dist.dir}"/>
		<copy	file="${doc.dir}/G11NToolKitRoadMap.html"
					todir="${dist.dir}"/>
  </target>

<!-- =================================================================== -->
	<target name="distsrc"
		depends="init, distlic"
		description="Make the Source Code distribution package.">
		<copy	file="build.xml"
					todir="${dist.dir}"/>
		<copy	todir="${dist.etc}">
			<fileset dir="${etc.dir}"/>
		</copy>
		<copy	todir="${dist.src}">
			<fileset dir="${src.dir}"/>
		</copy>
		<copy	todir="${dist.proc}">
			<fileset dir="${proc.dir}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-src.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="ReleaseNotes.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="G11NToolKitRoadMap.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="build.xml"/>
			<zipfileset	dir="${dist.src}"
									prefix="${src.dir}"/>
			<zipfileset	dir="${dist.etc}"
									prefix="${etc.dir}"/>
			<zipfileset	dir="${dist.proc}"
									prefix="${proc.dir}"/>
		</zip>
  </target>

<!-- =================================================================== -->
	<target name="distbin"
		depends="jar, distlic"
		description="Make the Executables distribution package.">
		<copy	todir="${dist.bin}">
			<fileset	dir="${bin.dir}"/>
		</copy>
		<copy	todir="${dist.etc}">
			<fileset dir="${etc.dir}"/>
		</copy>
		<copy	todir="${dist.lib}">
			<fileset	dir="${src.lib}"/>
			<fileset	dir="${build.lib}"/>
		</copy>
		<copy	todir="${dist.proc}">
			<fileset	dir="${proc.dir}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-bin.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="ReleaseNotes.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="G11NToolKitRoadMap.html"/>
			<zipfileset	dir="${dist.bin}"
									prefix="${bin.dir}"/>
			<zipfileset	dir="${dist.etc}"
									prefix="${etc.dir}"/>
			<zipfileset	dir="${dist.lib}"
									prefix="lib"/>
			<zipfileset	dir="${dist.proc}"
									prefix="${proc.dir}"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="distdoc"
		depends="javadoc, distlic"
		description="Make the Documentation distribution package.">
		<copy	todir="${dist.doc}">
			<fileset	dir="${doc.dir}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-doc.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="ReleaseNotes.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="G11NToolKitRoadMap.html"/>
			<zipfileset	dir="${dist.doc}"
									prefix="${doc.dir}"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="disttest"
		depends="distlic"
		description="Make the Test Suite distribution package.">
		<copy	todir="${dist.test}">
			<fileset	dir="${test.dir}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-test.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="ReleaseNotes.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="G11NToolKitRoadMap.html"/>
			<zipfileset	dir="${dist.test}"
									prefix="${test.dir}"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="distdev"
		depends="javadoc, distsrc, distdoc"
		description="Make the G11NToolKit Developer's distribution package.">
		<copy	todir="${dist.dev}">
			<fileset	dir="${dev.dir}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-dev.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.dev}"
									prefix="${dev.dir}"/>
			<zipfileset	dir="${dist.dir}"
									includes="ReleaseNotes.html"/>
			<zipfileset	dir="${dist.dir}"
									includes="G11NToolKitRoadMap.html"/>
			<zipfileset	src="${dist.dist}/${name}-${version}-src.zip"/>
			<zipfileset	src="${dist.dist}/${name}-${version}-doc.zip"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="distext"
		depends="init"
		description="Make the G11NToolKit Extensions distribution package.">
		<copy	todir="${dist.ext.bin}">
			<fileset	dir="${ext.bin}"/>
		</copy>
		<copy	todir="${dist.ext.doc}">
			<fileset	dir="${ext.doc}"/>
		</copy>
		<copy	todir="${dist.ext.etc}">
			<fileset	dir="${ext.etc}"/>
		</copy>
		<copy	todir="${dist.ext.lib}">
			<fileset	dir="${ext.lib}"/>
		</copy>
		<copy	todir="${dist.ext.proc}">
			<fileset	dir="${ext.proc}"/>
		</copy>
		<mkdir	dir="${dist.dist}"/>
		<zip	destfile="${dist.dist}/${name}-${version}-ext.zip">
			<zipfileset	dir="${dist.dir}"
									includes="license.txt"/>
			<zipfileset	dir="${dist.dir}"
									includes="licenseGPL.html"/>
			<zipfileset	dir="${dist.ext.bin}"
									prefix="${ext.bin}"/>
			<zipfileset	dir="${dist.ext.doc}"
									prefix="${ext.doc}"/>
			<zipfileset	dir="${dist.ext.etc}"
									prefix="${ext.etc}"/>
			<zipfileset	dir="${dist.ext.lib}"
									prefix="${ext.lib}"/>
			<zipfileset	dir="${dist.ext.proc}"
									prefix="${ext.proc}"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="distinstall"
		depends="distbin, distdoc, disttest, distext"
		description="Make the G11NToolKit Installation distribution package.">
		<mkdir	dir="${dist.install}"/>
		<copy	todir="${dist.install}">
			<fileset	dir="${install.dir}"/>
		</copy>
		<zip	destfile="${dist.install}/${name}-${version}-Install.zip">
			<zipfileset	dir="${dist.install}"
									includes="install.*"/>
			<zipfileset dir="${dist.dist}"
									includes="${name}-${version}-bin.zip"/>
			<zipfileset dir="${dist.dist}"
									includes="${name}-${version}-doc.zip"/>
			<zipfileset dir="${dist.dist}"
									includes="${name}-${version}-ext.zip"/>
			<zipfileset dir="${dist.dist}"
									includes="${name}-${version}-test.zip"/>
		</zip>
	</target>

<!-- =================================================================== -->
	<target name="dist"
		depends="distclean, distlic, distsrc, distbin, distdoc, disttest, distdev, distext, distinstall"
		description="Make all the distribution packages.">
	</target>

<!-- =================================================================== -->
	<target name="javadoc"
		depends="init"
		description="Produces the API documentation files in JavaDoc format for all the G11NToolKit classes.">
		<mkdir	dir="${doc.dir}"/>
		<delete	dir="${doc.dir.javadoc}"/>
		<javadoc	destdir="${doc.dir.javadoc}"
							private="true"
							author="true"
							version="true"
							use="true"
							windowtitle="G11N Tool Kit"
							Overview="${src.dir}/overview.html">
			<packageset dir="${src.dir}"
									defaultexcludes="yes">
				<include	name="${pkg.base.dir}/**" />
				<exclude	name="${src.parser}/java/javacc-3.2/**"/>
				<exclude	name="${src.parser}/html/nekohtml-0.9.3/**"/>
				<exclude name="${src.parser}/html/nekohtml-0.9.4/**"/>
				<exclude	name="${src.parser}/html/Test/**"/>
			</packageset>
			<classpath	refid="classpath.javadoc"/>
			<tag	name="to.do"
						scope="all"
						description="To do:" />
		</javadoc>
	</target>

<!-- =================================================================== -->
	<target name="all"
		depends="buildclean, jar, javadoc, dist, installdist"
		description="Make a clean build and distribution packages for the entire project.">
	</target>

<!-- =================================================================== -->
	<target name="installdist"
		depends="dist"
		description="Make a clean build and distribution packages for the entire project then distribution packages into the user installation directory so there is an install image ready for the install process.">
		<unzip	src="${dist.install}/${name}-${version}-Install.zip"
						dest="${installed.dir}"/>
	</target>

<!-- =================================================================== -->
	<target name="installbin"
		depends="jar, distbin"
		description="Make a clean build and binary distribution package for the project then unzip the bin package into the user installation directory.">
		<unzip	src="${dist.dist}/${name}-${version}-bin.zip"
						dest="${installed.dir}"/>
	</target>

<!-- =================================================================== -->
	<target name="installext"
		depends="jar, distext"
		description="Make a clean build and distribution packages for the entire project then unzip the extensions package into its directory. Use this target with caution since it will replace files that may have been modified by the extensions. You will probably need to install the extensions after running this target.">
		<unzip	src="${dist.dist}/${name}-${version}-ext.zip"
						dest="${installed.dir}"/>
	</target>

<!-- =================================================================== -->
	<target name="installtest"
		depends="jar, disttest"
		description="Make a clean build and test case distribution package for the project then unzip the test case package into the user installation directory.">
		<unzip	src="${dist.dist}/${name}-${version}-test.zip"
						dest="${installed.dir}"/>
	</target>

<!-- =================================================================== -->
	<target name="installdoc"
		depends="jar, distdoc"
		description="Make a clean build and documentation distribution package for the project then unzip the doc package into the user installation directory.">
		<unzip	src="${dist.dist}/${name}-${version}-doc.zip"
						dest="${installed.dir}"/>
	</target>

<!-- =================================================================== -->
</project>
