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