samples/instanceofclass/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:54:59 +0200
changeset 119 8147cafd007a
parent 75 aa07c59612ac
child 123 920e95b47036
permissions -rw-r--r--
Creating one master script that can clean and build all examples
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="instanceofclass" default="run" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     
     7     <target name="compile" depends="build"/>
     8     <target name="build">
     9         <antcall target="-build-one">
    10             <param name="version" value="api1.0"/>
    11         </antcall>
    12         <antcall target="-build-one">
    13             <param name="version" value="api2.0"/>
    14         </antcall>
    15     </target>
    16     
    17     <target name="run" depends="build">
    18         <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
    19         <antcall target="-run-one">
    20             <param name="version" value="api1.0"/>
    21         </antcall>
    22         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
    23         <antcall target="-run-one">
    24             <param name="version" value="api2.0"/>
    25         </antcall>
    26     </target>
    27 
    28     
    29     <!-- support methods -->
    30     
    31     <target name="-run-one">
    32         <fail message="You need to specify API version number" unless="version"/>
    33         <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Main"
    34             failonerror="true"
    35         />
    36     </target>
    37     
    38     <target name="-build-one">
    39         <fail message="You need to specify version number" unless="version"/>
    40         
    41         <mkdir dir="build/${version}/classes"/>
    42         <property name="cp" value=""/>
    43         <javac 
    44             srcdir="src-${version}" 
    45             destdir="build/${version}/classes" 
    46             source="1.5" target="1.5"
    47             classpath="${cp}"
    48         />
    49     </target>
    50 </project>