samples/growingparameters/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 03 Apr 2020 16:32:36 +0200
changeset 416 9ed8788a1a4e
parent 128 8ef997796d0a
permissions -rw-r--r--
Using HTTPS to download the libraries
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="growingparameters" default="run" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     <target name="test"/>
     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         <antcall target="-build-one">
    17             <param name="version" value="impl"/>
    18             <param name="cp" location="build/api2.0/classes"/>
    19         </antcall>
    20     </target>
    21     
    22     <target name="run" depends="build">
    23         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeeds."/>
    24         <antcall target="-run-one">
    25             <param name="version" value="api2.0"/>
    26         </antcall>
    27     </target>
    28 
    29     
    30     <!-- support methods -->
    31     
    32     <target name="-run-one">
    33         <fail message="You need to specify API version number" unless="version"/>
    34         <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Impl"
    35             failonerror="true" 
    36         >
    37             <jvmarg value="-ea"/>
    38         </java>
    39     </target>
    40     
    41     <target name="-build-one">
    42         <fail message="You need to specify version number" unless="version"/>
    43         
    44         <mkdir dir="build/${version}/classes"/>
    45         <property name="cp" value=""/>
    46         <javac 
    47             srcdir="src-${version}" 
    48             destdir="build/${version}/classes" 
    49             source="1.5" target="1.5"
    50             classpath="${cp}"
    51         />
    52     </target>
    53 </project>