1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="Build Script" default="test" basedir=".">
7 <target name="compile" depends="build"/>
8 <target name="build" depends="-libraries">
9 <antcall target="-build-one">
10 <param name="version" value="api1.0"/>
12 <antcall target="-build-one">
13 <param name="version" value="api2.0"/>
15 <antcall target="-build-one">
16 <param name="version" value="api2.0-compat"/>
18 <antcall target="-build-one">
19 <param name="version" value="api2.0-property"/>
21 <antcall target="-build-one">
22 <param name="version" value="api2.0-enum"/>
25 <antcall target="-build-one">
26 <param name="version" value="test"/>
27 <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
31 <target name="test" depends="build">
32 <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
33 <antcall target="-run-one">
34 <param name="version" value="api1.0"/>
36 <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
37 <antcall target="-run-one">
38 <param name="version" value="api2.0"/>
40 <echo level="info" message="Running the Implementation against Version 2.0 with compatible extension of the API. This should succeed."/>
41 <antcall target="-run-one">
42 <param name="version" value="api2.0-compat"/>
44 <echo level="info" message="Running the Implementation against Version 2.0 with property guarded extension of the API. This should succeed."/>
45 <antcall target="-run-one">
46 <param name="version" value="api2.0-property"/>
48 <echo level="info" message="Running the Implementation against Version 2.0 with enum guarded extension of the API. This should succeed."/>
49 <antcall target="-run-one">
50 <param name="version" value="api2.0-enum"/>
54 <!-- support methods -->
56 <target name="-libraries">
59 <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
62 <target name="-run-one">
63 <fail message="You need to specify API version number" unless="version"/>
64 <mkdir dir="build/testresults"/>
65 <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
66 <batchtest todir="build/testresults">
67 <fileset dir="build/test/classes">
68 <filename name="**/*Test.class"/>
72 <path location="build/${version}/classes"/>
73 <path location="build/test/classes"/>
74 <path location="${junit.jar}"/>
76 <formatter type="brief" usefile="false"/>
77 <formatter type="xml"/>
81 <target name="-build-one">
82 <fail message="You need to specify version number" unless="version"/>
84 <mkdir dir="build/${version}/classes"/>
85 <property name="cp" value=""/>
87 srcdir="src-${version}"
88 destdir="build/${version}/classes"
89 source="1.5" target="1.5"