Permalink
Browse files

got ant test target to work

  • Loading branch information...
1 parent 076347e commit 48925cbcf8027ace2ffbcb00b76764cdddd1d2ab @leadVisionary committed Jul 10, 2012
Showing with 28 additions and 8 deletions.
  1. +28 −8 build.xml
View
@@ -3,6 +3,19 @@
<property name="test.dir" value="test" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="bin" />
+ <property name="classes.dir" value="${build.dir}/classes" />
+ <property name="testClasses.dir" value="${classes.dir}/tests" />
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <path id="classpath.test">
+ <pathelement location="${classes.dir}" />
+ <pathelement location="${testClasses.dir}" />
+ <path refid="classpath" />
+ </path>
+
<target name="clean" description="--> clean the project">
<delete dir="${build.dir}">
@@ -13,23 +26,30 @@
<target name="resolve">
<ivy:retrieve />
</target>
-
+
<target name="compile">
- <mkdir dir="${build.dir}/classes"/>
- <javac srcdir="${src.dir}" destdir="${build.dir}/classes"
- includeantruntime="false">
+ <mkdir dir="${classes.dir}"/>
+ <javac srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="classpath"
+ includeantruntime="false">
</javac>
</target>
<target name="test" depends="resolve,compile">
- <mkdir dir="${build.dir}/classes/tests"/>
- <javac srcdir="${test.dir}" destdir="${build.dir}/classes/tests"
- includeantruntime="false">
+ <mkdir dir="${testClasses.dir}"/>
+ <javac srcdir="${test.dir}"
+ destdir="${testClasses.dir}"
+ includeantruntime="false"
+ classpathref="classpath.test" >
</javac>
<junit>
+ <classpath>
+ <path refid="classpath.test" />
+ </classpath>
<formatter type="brief" usefile="false" />
<batchtest>
- <fileset dir="${build.dir}/classes/tests" includes="**/*.class" />
+ <fileset dir="${testClasses.dir}" includes="**/*.class" />
</batchtest>
</junit>
</target>

0 comments on commit 48925cb

Please sign in to comment.