summaryrefslogtreecommitdiffstats
path: root/build.xml
diff options
context:
space:
mode:
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml24
1 files changed, 23 insertions, 1 deletions
diff --git a/build.xml b/build.xml
index 1c1a5f0..24d18f0 100644
--- a/build.xml
+++ b/build.xml
@@ -3,13 +3,19 @@
<target name="init">
<property name="src" value="${basedir}/src"/>
- <property name="out" value="${basedir}/out"/>
+ <property name="out" value="${basedir}/out/production"/>
<property name="dist" value="${basedir}/fernflower.jar"/>
+ <property name="test-src" value="${basedir}/test"/>
+ <property name="test-out" value="${basedir}/out/test"/>
+ <!-- external dependencies, adjust to your own -->
+ <property name="junit" value="${basedir}/../../../lib/junit-4.11.jar"/>
+ <property name="hamcrest" value="${basedir}/../../../lib/hamcrest-core-1.3.jar"/>
</target>
<target name="clean" depends="init">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${out}"/>
+ <fileset dir="${test-out}"/>
<fileset file="${dist}"/>
</delete>
</target>
@@ -27,4 +33,20 @@
</jar>
</target>
+ <target name="test-compile" depends="init,compile">
+ <mkdir dir="${test-out}"/>
+ <javac srcdir="${test-src}" destdir="${test-out}" source="1.6" target="1.6" encoding="UTF-8" debug="true" includeantruntime="false">
+ <classpath path="${out}:${junit}:${hamcrest}"/>
+ </javac>
+ </target>
+
+ <target name="test" depends="init,test-compile">
+ <junit printsummary="true" haltonfailure="true">
+ <classpath path="${test-out}:${out}:${junit}:${hamcrest}"/>
+ <batchtest>
+ <fileset dir="${test-src}" includes="**/*Test.java"/>
+ </batchtest>
+ </junit>
+ </target>
+
</project>