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