File name
Commit message
Commit date
<?xml version="1.0" encoding="UTF-8"?>
<project name="projx" default="all" basedir=".">
<description>Builds, tests, and runs projx</description>
<property name="build.dir" value="./"/>
<property name="src.dir" location="${build.dir}/src"/>
<property name="test.dir" location="${build.dir}/test/src"/>
<property name="test.htmlreports.dir" location="${build.dir}/test/htmlreports"/>
<property name="test.data.dir" location="${build.dir}/test/data"/>
<property name="junit.class.name" value="com.megacorp.projx.JUnit.AllTests"/>
<!-- Classpath to find java packages -->
<path id="classpath.base">
<pathelement location="/usr/java/latest/lib/tools.jar" />
</path
<!-- Classpath for tests to find src packages -->
<path id="classpath.src">
<pathelement location="src" />
</path>
<path id="classpath.junittest"2
<path refid="classpath.base" />
<pathelement location="/opt/lib/junit-4.9b2.jar" />
<pathelement location="${test.dir}" />
</path>
<target name="clean" description="Remove all .class files">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${src.dir}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${test.dir}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${test.htmlreports.dir}">
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.html"/>
</fileset>
</delete>
</target>
<target name="compile">
<javac srcdir="${src.dir}" destdir="${src.dir}" debug="true" includeAntRuntime="false">
<classpath refid="classpath.base"/>
<include name="**/*.java"/>
</javac>
</target>
<target name="compile-test" depends="compile">
<javac srcdir="${test.dir}" destdir="${test.dir}" debug="true" includes="${src.dir}" includeAntRuntime="false">
<classpath refid="classpath.base"/>
53
<classpath refid="classpath.src"/>
54
<classpath refid="classpath.junittest"/>
55
<include name="**/*.java"/>
56
</javac>
57
</target>
58
59
<target name="test" depends="compile-test">
60
<mkdir dir="${test.data.dir}"/>
61
<mkdir dir="${test.htmlreports.dir}"/>
62
<junit fork="no" haltonfailure="no" showoutput="yes" printsummary="true">
63
<test name="${junit.class.name}" todir="${test.data.dir}"/>
64
<formatter type="brief" usefile="false"/>
65
<formatter type="xml"/>
66
<classpath refid="classpath.base" />
67
<classpath refid="classpath.src" />
68
<classpath refid="classpath.junittest" />
69
</junit>
70
<junitreport todir="${test.htmlreports.dir}">
71
<fileset dir="${test.data.dir}">
72
<include name="TEST-*.xml"/>
73
</fileset>
74
<report format="frames" todir="${test.htmlreports.dir}"/>
75
</junitreport>
76
</target>
77
78
<target name="all" depends="compile-test" />
79
80
</project>