samples/composition/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:58:11 +0200
changeset 154 0fd5e9c500b9
parent 153 b5cbb797ec0a
child 155 c00f947c0936
permissions -rw-r--r--
Merge: Geertjan's changs up to 2000
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="Build Script" default="test" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     
     7     <target name="compile" depends="build"/>
     8     <target name="build" depends="-libraries">
     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         <antcall target="-build-one">
    16             <param name="version" value="api2.0-compat"/>
    17         </antcall>
    18         <antcall target="-build-one">
    19             <param name="version" value="api2.0-property"/>
    20         </antcall>
    21         <antcall target="-build-one">
    22             <param name="version" value="api2.0-enum"/>
    23         </antcall>
    24         
    25         <antcall target="-build-one">
    26             <param name="version" value="test"/>
    27             <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
    28         </antcall>
    29     </target>
    30     
    31     <target name="test" depends="build">
    32         <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    33         <antcall target="-run-one">
    34             <param name="version" value="api1.0"/>
    35         </antcall>
    36         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    37         <antcall target="-run-one">
    38             <param name="version" value="api2.0"/>
    39         </antcall>
    40         <echo level="info" message="Running the Implementation against Version 2.0 with compatible extension of the API. This should succeed."/>
    41         <antcall target="-run-one">
    42             <param name="version" value="api2.0-compat"/>
    43         </antcall>
    44         <echo level="info" message="Running the Implementation against Version 2.0 with property guarded extension of the API. This should succeed."/>
    45         <antcall target="-run-one">
    46             <param name="version" value="api2.0-property"/>
    47         </antcall>
    48         <echo level="info" message="Running the Implementation against Version 2.0 with enum guarded extension of the API. This should succeed."/>
    49         <antcall target="-run-one">
    50             <param name="version" value="api2.0-enum"/>
    51         </antcall>
    52     </target>
    53     
    54     <!-- support methods -->
    55     
    56     <target name="-libraries">
    57         <ant dir="../libs/"/>
    58         
    59         <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
    60     </target>
    61     
    62     <target name="-run-one">
    63         <fail message="You need to specify API version number" unless="version"/>
    64         <mkdir dir="build/testresults"/>
    65         <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    66             <batchtest todir="build/testresults">
    67                 <fileset dir="build/test/classes">
    68                     <filename name="**/*Test.class"/>
    69                 </fileset>
    70             </batchtest>
    71             <classpath>
    72                 <path location="build/${version}/classes"/>
    73                 <path location="build/test/classes"/>
    74                 <path location="${junit.jar}"/>
    75             </classpath>
    76             <formatter type="brief" usefile="false"/>
    77             <formatter type="xml"/>
    78         </junit>
    79     </target>
    80     
    81     <target name="-build-one">
    82         <fail message="You need to specify version number" unless="version"/>
    83         
    84         <mkdir dir="build/${version}/classes"/>
    85         <property name="cp" value=""/>
    86         <javac 
    87             srcdir="src-${version}" 
    88             destdir="build/${version}/classes" 
    89             source="1.5" target="1.5"
    90             classpath="${cp}"
    91         />
    92     </target>
    93 </project>