1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
<project name="jFormatString" default="build">
<property file="local.properties" />
<property file="build.properties" />
<target name="build" depends="clean,jarFile" />
<target name="classes">
<mkdir dir="build/classes" />
<javac destdir="build/classes" source="1.5" target="1.5" debug="on"
includeantruntime="false">
<src path="src/java" />
<src path="src/junit" />
<classpath>
<pathelement path="/usr/share/java/junit4.jar"/>
<pathelement location="build/classes" />
</classpath>
</javac>
</target>
<target name="jarFile" depends="classes">
<jar destfile="build/jFormatString.jar">
<fileset dir="build/classes">
<include name="**/*.class" />
</fileset>
<fileset dir="src/java">
<include name="**/*.java" />
</fileset>
</jar>
</target>
<property name="junit.dir" value="build/junit" />
<target name="test" depends="classes">
<echo>Running JUnit test cases for jformatstring...</echo>
<delete dir="${junit.dir}"/>
<mkdir dir="${junit.dir}"/>
<junit
fork="yes"
printsummary="true"
haltonfailure="true"
haltonerror="true">
<classpath>
<pathelement path="build/classes"/>
<pathelement path="/usr/share/java/junit4.jar"/>
</classpath>
<formatter type="xml"/>
<!-- junit needs fileset to point to .java files (not .class) -->
<batchtest todir="${junit.dir}">
<fileset dir="src/junit">
<include name="**/*Test.java"/>
<include name="**/Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="clean">
<delete dir="build/classes" />
</target>
</project>
<!-- vim:set ts=4: -->
|