<?xml version="1.0" encoding="UTF-8"?>
<project name="localjunit" default="all">

	<property name="build.dir"               value="build"/>
	<property name="build.dir.classes"       value="${build.dir}/classes"/>
	<property name="src.dir"	         value="src"/>
	<property name="reports.dir"	         value="reports"/>
	<property name="javac.debug"             value="on"/>
	<property name="javac.optimize"          value="off"/>

	<path id="tests.classpath">
		<pathelement location="ext/commons-httpclient.jar"/>
		<pathelement location="ext/commons-logging.jar"/>
		<pathelement location="ext/commons-codec.jar"/>
		<pathelement location="../ext/junit.jar"/>
	</path>

	<target name="all" depends="init,jar">
	</target>

    <target name="clean">
        <delete dir="${build.dir}"/>
        <delete dir="${reports.dir}"/>
    </target>

    <target name="init" depends="clean,init-dir"/>

    <target name="init-dir">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.dir.classes}"/>
        <mkdir dir="${reports.dir}"/>
    </target>

	<target name="compile">
		<javac destdir="${build.dir.classes}" debug="${javac.debug}" optimize="${javac.optimize}">
			<classpath>
				<path refid="tests.classpath" />
			</classpath>
			<src path="${src.dir}" />
		</javac>
	</target>

	<target name="jar" depends="compile">
		<jar jarfile="${build.dir}/localjunit.jar">
			<fileset dir="${build.dir.classes}" />
		</jar>
	</target>

</project>
