samples/delegatingwriterfinal/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:53:06 +0200
changeset 66 8379bb7c0dff
parent 65 4db7ceebd2b3
child 119 8147cafd007a
permissions -rw-r--r--
Tests rewritten to new version, just the Writer version 2.0 does not yet implement Appendable
     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="test1.0"/>
    17             <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
    18         </antcall>
    19 
    20         <antcall target="-build-one">
    21             <param name="version" value="test2.0"/>
    22             <param name="cp" value="build/api2.0/classes:${junit.jar}"/>
    23         </antcall>
    24     </target>
    25     
    26     <target name="test" depends="build">
    27         <echo level="info" message="Running the Old Implementation against Version 1.0 of the API. This should succeed."/>
    28         <antcall target="-run-one">
    29             <param name="version" value="api1.0"/>
    30         </antcall>
    31         <echo level="info" message="Running the Old Implementation against Version 2.0 of the API. This should succeed."/>
    32         <antcall target="-run-one">
    33             <param name="version" value="api2.0"/>
    34         </antcall>
    35         <echo level="info" message="Running the New Implementation against Version 2.0 of the API. This should succeed."/>
    36         <antcall target="-run-two">
    37             <param name="version" value="api2.0"/>
    38         </antcall>
    39     </target>
    40     
    41     <!-- support methods -->
    42     
    43     <target name="-libraries">
    44         <ant dir="../libs/"/>
    45         
    46         <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
    47     </target>
    48     
    49     <target name="-run-one">
    50         <fail message="You need to specify API version number" unless="version"/>
    51         <mkdir dir="build/testresults"/>
    52         <junit dir="build/test1.0/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    53             <batchtest todir="build/testresults">
    54                 <fileset dir="build/test1.0/classes">
    55                     <filename name="**/*Test.class"/>
    56                 </fileset>
    57             </batchtest>
    58             <classpath>
    59                 <path location="build/${version}/classes"/>
    60                 <path location="build/test1.0/classes"/>
    61                 <path location="${junit.jar}"/>
    62             </classpath>
    63             <formatter type="brief" usefile="false"/>
    64             <formatter type="xml"/>
    65         </junit>
    66     </target>
    67 
    68     <target name="-run-two">
    69         <fail message="You need to specify API version number" unless="version"/>
    70         <mkdir dir="build/testresults"/>
    71         <junit dir="build/test2.0/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    72             <batchtest todir="build/testresults">
    73                 <fileset dir="build/test2.0/classes">
    74                     <filename name="**/*Test.class"/>
    75                 </fileset>
    76             </batchtest>
    77             <classpath>
    78                 <path location="build/${version}/classes"/>
    79                 <path location="build/test2.0/classes"/>
    80                 <path location="${junit.jar}"/>
    81             </classpath>
    82             <formatter type="brief" usefile="false"/>
    83             <formatter type="xml"/>
    84         </junit>
    85     </target>
    86     
    87     <target name="-build-one">
    88         <fail message="You need to specify version number" unless="version"/>
    89         
    90         <mkdir dir="build/${version}/classes"/>
    91         <property name="cp" value=""/>
    92         <javac 
    93             srcdir="src-${version}" 
    94             destdir="build/${version}/classes" 
    95             source="1.5" target="1.5"
    96             classpath="${cp}"
    97         />
    98     </target>
    99 </project>