samples/insertsuperclass/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 20:46:27 +0100
changeset 408 9a439a79c6d0
parent 278 c15f77497f6a
permissions -rw-r--r--
Use scala 2.10.4 to compile on JDK8
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="insertsuperclass" default="run" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     <target name="test" depends="run"/>
     7     
     8     <target name="compile" depends="build"/>
     9     <target name="build">
    10         <antcall target="-build-one">
    11             <param name="version" value="api1.0"/>
    12         </antcall>
    13         <antcall target="-build-one">
    14             <param name="version" value="api2.0"/>
    15         </antcall>
    16         <echo level="info" message="Compiling the Implementation against Version 1.0 of the API. This should succeed."/>
    17         <antcall target="-build-one">
    18             <param name="version" value="impl"/>
    19             <param name="cp" location="build/api1.0/classes"/>
    20         </antcall>
    21     </target>
    22     
    23     <target name="run" depends="build">
    24         <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
    25         <antcall target="-run-one">
    26             <param name="version" value="api1.0"/>
    27         </antcall>
    28         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
    29         <antcall target="-run-one">
    30             <param name="version" value="api2.0"/>
    31         </antcall>
    32     </target>
    33 
    34     
    35     <!-- support methods -->
    36     
    37     <target name="-run-one">
    38         <fail message="You need to specify API version number" unless="version"/>
    39         <java classpath="build/${version}/classes:build/impl/classes" classname="org.apidesign.insertsuperclass.test.Main"
    40             failonerror="true" fork="true">
    41             <jvmarg value="-ea"/>
    42         </java>
    43     </target>
    44     
    45     <target name="-build-one">
    46         <fail message="You need to specify version number" unless="version"/>
    47         
    48         <mkdir dir="build/${version}/classes"/>
    49         <property name="cp" value=""/>
    50         <javac 
    51             srcdir="src-${version}" 
    52             destdir="build/${version}/classes" 
    53             source="1.5" target="1.5"
    54             classpath="${cp}"
    55             debug="true"
    56         />
    57     </target>
    58 </project>