samples/primitiveconstants/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:50:51 +0200
changeset 8 82ff02d7f861
parent 7 041165540a13
child 9 45a6b338a903
permissions -rw-r--r--
constants demonstrated in real project
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="primitiveconstants" default="run" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     
     7     <target name="build">
     8         <antcall target="-build-one">
     9             <param name="version" value="api1.0"/>
    10         </antcall>
    11         <antcall target="-build-one">
    12             <param name="version" value="api2.0"/>
    13         </antcall>
    14         <antcall target="-build-one">
    15             <param name="version" value="impl"/>
    16             <param name="cp" location="build/api1.0/classes"/>
    17         </antcall>
    18     </target>
    19     
    20     <target name="run" depends="build">
    21         <echo message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    22         <antcall target="-run-one">
    23             <param name="version" value="api1.0"/>
    24         </antcall>
    25         <echo message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    26         <antcall target="-run-one">
    27             <param name="version" value="api2.0"/>
    28         </antcall>
    29     </target>
    30 
    31     
    32     <!-- support methods -->
    33     
    34     <target name="-run-one">
    35         <fail message="You need to specify API version number" unless="version"/>
    36         <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Impl"
    37             failonerror="true"
    38         />
    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.4" target="1.4"
    50             classpath="${cp}"
    51         />
    52     </target>
    53 </project>