<project name="RoundTripTests" default="dist" basedir=".">

	<property name="version" value="0.1"/>        
	<property name="app.jar" value="RoundTripTests.jar"/>
        <property name="build.dir" value="build" />
        <property name="dist.dir"  value="dist" />
        <property name="package.dir"  value="package" />

	<path id="compile.class.path">
                <pathelement location="../FastInfoset/dist/FastInfoset.jar"/>
		<pathelement location="lib/xerces.jar"/>
	</path>

	<target name="prepare">
                <tstamp>
                    <format property="TSTAMP" pattern="hhmmss"/>
                </tstamp>
		<mkdir dir="${build.dir}/classes"/>
		<mkdir dir="${dist.dir}"/>
		<mkdir dir="${package.dir}"/>
	</target>

	<target name="clean">
		<delete quiet="true" dir="${dist.dir}"/>
		<delete dir="${build.dir}"/>
	</target>

	<target name="compile" depends="prepare">
		<javac srcdir="src" destdir="${build.dir}/classes"
			debug="on" optimize="on" deprecation="on">
			<classpath refid="compile.class.path"/>
		</javac>
	</target>

	<target name="dist" depends="compile">
		<jar jarfile="${dist.dir}/${app.jar}"
			basedir="${build.dir}/classes"/>
	</target>
        
	<target name="doc" depends="dist">
		<javadoc sourcepath="src"
                        packagenames="com.sun.xml.fastinfoset.roundtriptests.*"
			destdir="${dist.dir}/javadoc"
                        version="true">
                </javadoc>
	</target>

        <target name="package-contents" depends="doc">
            <copy todir="${package.dir}/${ant.project.name}_${version}_${DSTAMP}_${TSTAMP}">
                <fileset dir="dist">
                    <include name="javadoc/**"/>
                </fileset>
                <fileset dir="${basedir}">
                    <include name="README-PACKAGE.txt"/>
                    <include name="bin/*"/>
                    <include name="lib/*.jar"/>
                    <include name="${dist.dir}/${app.jar}"/>
                </fileset>
                <fileset dir="${basedir}/..">
                    <include name="LICENSE.txt"/>
                </fileset>
            </copy>
        </target>

        <target name="package" depends="package-contents">
            <zip destfile="${package.dir}/${ant.project.name}_${version}_${DSTAMP}_${TSTAMP}.zip">
                <fileset dir="${package.dir}">
                    <include name="${ant.project.name}_${version}_${DSTAMP}_${TSTAMP}/**"/>
                </fileset>                
            </zip>
        </target>

        
</project>
