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