1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="Build Script" default="test" basedir=".">
7 <target name="build" depends="-libraries">
8 <antcall target="-build-one">
9 <param name="version" value="api1.0"/>
11 <antcall target="-build-one">
12 <param name="version" value="api2.0"/>
15 <antcall target="-build-one">
16 <param name="version" value="test"/>
17 <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
21 <target name="test" depends="build">
22 <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
23 <antcall target="-run-one">
24 <param name="version" value="api1.0"/>
26 <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
27 <antcall target="-run-one">
28 <param name="version" value="api2.0"/>
32 <!-- support methods -->
34 <target name="-libraries">
37 <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
40 <target name="-run-one">
41 <fail message="You need to specify API version number" unless="version"/>
42 <mkdir dir="build/testresults"/>
43 <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
44 <batchtest todir="build/testresults">
45 <fileset dir="build/test/classes">
46 <filename name="**/*Test.class"/>
50 <path location="build/${version}/classes"/>
51 <path location="build/test/classes"/>
52 <path location="${junit.jar}"/>
54 <formatter type="brief" usefile="false"/>
55 <formatter type="xml"/>
59 <target name="-build-one">
60 <fail message="You need to specify version number" unless="version"/>
62 <mkdir dir="build/${version}/classes"/>
63 <property name="cp" value=""/>
65 srcdir="src-${version}"
66 destdir="build/${version}/classes"
67 source="1.5" target="1.5"