1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/instanceofclass/build.xml Sat Jun 14 09:53:34 2008 +0200
1.3 @@ -0,0 +1,49 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +<project name="instanceofclass" default="run" basedir=".">
1.6 + <target name="clean">
1.7 + <delete dir="build"/>
1.8 + </target>
1.9 +
1.10 + <target name="build">
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 + </target>
1.18 +
1.19 + <target name="run" depends="build">
1.20 + <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
1.21 + <antcall target="-run-one">
1.22 + <param name="version" value="api1.0"/>
1.23 + </antcall>
1.24 + <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
1.25 + <antcall target="-run-one">
1.26 + <param name="version" value="api2.0"/>
1.27 + </antcall>
1.28 + </target>
1.29 +
1.30 +
1.31 + <!-- support methods -->
1.32 +
1.33 + <target name="-run-one">
1.34 + <fail message="You need to specify API version number" unless="version"/>
1.35 + <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Main"
1.36 + failonerror="true"
1.37 + />
1.38 + </target>
1.39 +
1.40 + <target name="-build-one">
1.41 + <fail message="You need to specify version number" unless="version"/>
1.42 +
1.43 + <mkdir dir="build/${version}/classes"/>
1.44 + <property name="cp" value=""/>
1.45 + <javac
1.46 + srcdir="src-${version}"
1.47 + destdir="build/${version}/classes"
1.48 + source="1.5" target="1.5"
1.49 + classpath="${cp}"
1.50 + />
1.51 + </target>
1.52 +</project>