<?xml version="1.0"?>
<project name="annox-sample-po-ant" default="install">
	<property name="artifactId" value="annox-sample-po-ant"/>
	<property name="version" value="0.4.3"/>
	<path id="compile.path">
		<fileset dir="${basedir}/lib">
			<include name="activation-*.jar"/>
			<include name="annox-*.jar"/>
			<include name="commons-lang-*.jar"/>
			<include name="jaxb-api-*.jar"/>
			<include name="jaxb-impl-*.jar"/>
			<include name="stax-api-*.jar"/>
		</fileset>
	</path>
	<path id="test-compile.path">
		<fileset dir="${basedir}/lib">
			<include name="activation-*.jar"/>
			<include name="annox-*.jar"/>
			<include name="commons-lang-*.jar"/>
			<include name="jaxb-api-*.jar"/>
			<include name="jaxb-impl-*.jar"/>
			<include name="stax-api-*.jar"/>
			<include name="junit-*.jar"/>
		</fileset>
		<pathelement path="${basedir}/target/classes"/>
	</path>
	<path id="test.path">
		<fileset dir="${basedir}/lib">
			<include name="activation-*.jar"/>
			<include name="annox-*.jar"/>
			<include name="commons-lang-*.jar"/>
			<include name="jaxb-api-*.jar"/>
			<include name="jaxb-impl-*.jar"/>
			<include name="stax-api-*.jar"/>
		</fileset>
	</path>
	<target name="clean">
		<delete dir="${basedir}/target/"/>
		<delete dir="${basedir}/target/classes"/>
		<delete dir="${basedir}/target/test-classes"/>
	</target>
	<target name="generate-sources">
	</target>
	<target name="compile" depends="generate-sources">
		<mkdir dir="${basedir}/target/classes"/>
		<javac
			destdir="${basedir}/target/classes" 
			srcdir="${basedir}/src/main/java"
			classpathref="compile.path"
			source="1.5"
			target="1.5">
		</javac>
		<copy todir="${basedir}/target/classes">
			<fileset dir="${basedir}/src/main/resources"/>
		</copy>
	</target>
	<target name="test-compile" depends="compile">
		<mkdir dir="${basedir}/target/test-classes"/>
		<javac
			destdir="${basedir}/target/test-classes" 
			srcdir="${basedir}/src/test/java"
			classpathref="test-compile.path"
			source="1.5"
			target="1.5">
		</javac>
		<copy todir="${basedir}/target/test-classes">
			<fileset dir="${basedir}/src/test/resources"/>
		</copy>
	</target>
	<target name="test" depends="test-compile">
		<mkdir dir="${basedir}/target/junit-reports"/>
		<junit printsummary="yes" haltonfailure="yes">
			<classpath>
				<pathelement location="${basedir}/target/classes"/>
				<pathelement location="${basedir}/target/test-classes"/>
				<path refid="test.path"/>
			</classpath>

			<formatter type="plain"/>
			<formatter type="xml"/>

			<batchtest fork="yes" todir="${basedir}/target/junit-reports">
				<fileset dir="${basedir}/src/test/java">
					<include name="**/*Test*.java"/>
					<exclude name="**/AllTests.java"/>
				</fileset>
			</batchtest>
		</junit>
	</target>
	<target name="package" depends="test">
		<mkdir dir="${basedir}/target"/>
		<jar destfile="${basedir}/target/${artifactId}-${version}.jar"
			basedir="${basedir}/target/classes"/> 
	</target>
	<target name="install" depends="package"/>
</project>