samples/consistency/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:55:09 +0200
changeset 127 07696c62f340
parent 124 6270b19ab8db
child 128 8ef997796d0a
permissions -rw-r--r--
part 2 of polishing "review2" areas
     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="build" depends="-libraries">
     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         
    15         <antcall target="-build-one">
    16             <param name="version" value="test"/>
    17             <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
    18         </antcall>
    19     </target>
    20     
    21     <target name="test" depends="build">
    22         <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    23         <antcall target="-run-one">
    24             <param name="version" value="api1.0"/>
    25         </antcall>
    26         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    27         <antcall target="-run-one">
    28             <param name="version" value="api2.0"/>
    29         </antcall>
    30     </target>
    31     
    32     <!-- support methods -->
    33     
    34     <target name="-libraries">
    35         <ant dir="../libs/"/>
    36         
    37         <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
    38     </target>
    39     
    40     <target name="-run-one">
    41         <fail message="You need to specify API version number" unless="version"/>
    42         <mkdir dir="build/testresults"/>
    43         <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    44             <batchtest todir="build/testresults">
    45                 <fileset dir="build/test/classes">
    46                     <filename name="**/*Test.class"/>
    47                 </fileset>
    48             </batchtest>
    49             <classpath>
    50                 <path location="build/${version}/classes"/>
    51                 <path location="build/test/classes"/>
    52                 <path location="${junit.jar}"/>
    53             </classpath>
    54             <formatter type="brief" usefile="false"/>
    55             <formatter type="xml"/>
    56         </junit>
    57     </target>
    58     
    59     <target name="-build-one">
    60         <fail message="You need to specify version number" unless="version"/>
    61         
    62         <mkdir dir="build/${version}/classes"/>
    63         <property name="cp" value=""/>
    64         <javac 
    65             srcdir="src-${version}" 
    66             destdir="build/${version}/classes" 
    67             source="1.5" target="1.5"
    68             classpath="${cp}"
    69         />
    70     </target>
    71 </project>