1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/reexport/build.xml Sat Jun 14 09:54:12 2008 +0200
1.3 @@ -0,0 +1,76 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<project name="Build Script" default="test" basedir=".">
1.6 + <target name="clean">
1.7 + <delete dir="build"/>
1.8 + </target>
1.9 +
1.10 + <target name="build" depends="-libraries">
1.11 + <antcall target="-build-one">
1.12 + <param name="version" value="api1.0"/>
1.13 + </antcall>
1.14 + <antcall target="-build-one">
1.15 + <param name="version" value="api2.0"/>
1.16 + </antcall>
1.17 + <antcall target="-build-one">
1.18 + <param name="version" value="query"/>
1.19 + <param name="cp" value="build/api1.0/classes"/>
1.20 + </antcall>
1.21 +
1.22 + <antcall target="-build-one">
1.23 + <param name="version" value="test"/>
1.24 + <param name="cp" value="build/api1.0/classes:build/query/classes:${junit.jar}"/>
1.25 + </antcall>
1.26 + </target>
1.27 +
1.28 + <target name="test" depends="build">
1.29 + <echo level="info" message="Running the Test against Query and Version 1.0 of String. This should succeeds."/>
1.30 + <antcall target="-run-one">
1.31 + <param name="version" value="api1.0"/>
1.32 + </antcall>
1.33 + <echo level="info" message="Running the Test against Query and Version 2.0 of String. This should fail."/>
1.34 + <antcall target="-run-one">
1.35 + <param name="version" value="api2.0"/>
1.36 + </antcall>
1.37 + </target>
1.38 +
1.39 + <!-- support methods -->
1.40 +
1.41 + <target name="-libraries">
1.42 + <ant dir="../libs/"/>
1.43 +
1.44 + <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
1.45 + </target>
1.46 +
1.47 + <target name="-run-one">
1.48 + <fail message="You need to specify API version number" unless="version"/>
1.49 + <mkdir dir="build/testresults"/>
1.50 + <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
1.51 + <batchtest todir="build/testresults">
1.52 + <fileset dir="build/test/classes">
1.53 + <filename name="**/*Test.class"/>
1.54 + </fileset>
1.55 + </batchtest>
1.56 + <classpath>
1.57 + <path location="build/${version}/classes"/>
1.58 + <path location="build/query/classes"/>
1.59 + <path location="build/test/classes"/>
1.60 + <path location="${junit.jar}"/>
1.61 + </classpath>
1.62 + <formatter type="brief" usefile="false"/>
1.63 + <formatter type="xml"/>
1.64 + </junit>
1.65 + </target>
1.66 +
1.67 + <target name="-build-one">
1.68 + <fail message="You need to specify version number" unless="version"/>
1.69 +
1.70 + <mkdir dir="build/${version}/classes"/>
1.71 + <property name="cp" value=""/>
1.72 + <javac
1.73 + srcdir="src-${version}"
1.74 + destdir="build/${version}/classes"
1.75 + source="1.5" target="1.5"
1.76 + classpath="${cp}"
1.77 + />
1.78 + </target>
1.79 +</project>