samples/consistency/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
parent 127 07696c62f340
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run 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="test"/>
    18             <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
    19         </antcall>
    20     </target>
    21     
    22     <target name="test" depends="build">
    23         <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    24         <antcall target="-run-one">
    25             <param name="version" value="api1.0"/>
    26         </antcall>
    27         <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    28         <antcall target="-run-one">
    29             <param name="version" value="api2.0"/>
    30         </antcall>
    31     </target>
    32     
    33     <!-- support methods -->
    34     
    35     <target name="-libraries">
    36         <ant dir="../libs/"/>
    37         
    38         <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
    39     </target>
    40     
    41     <target name="-run-one">
    42         <fail message="You need to specify API version number" unless="version"/>
    43         <mkdir dir="build/testresults"/>
    44         <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    45             <batchtest todir="build/testresults">
    46                 <fileset dir="build/test/classes">
    47                     <filename name="**/*Test.class"/>
    48                 </fileset>
    49             </batchtest>
    50             <classpath>
    51                 <path location="build/${version}/classes"/>
    52                 <path location="build/test/classes"/>
    53                 <path location="${junit.jar}"/>
    54             </classpath>
    55             <formatter type="brief" usefile="false"/>
    56             <formatter type="xml"/>
    57         </junit>
    58     </target>
    59     
    60     <target name="-build-one">
    61         <fail message="You need to specify version number" unless="version"/>
    62         
    63         <mkdir dir="build/${version}/classes"/>
    64         <property name="cp" value=""/>
    65         <javac 
    66             srcdir="src-${version}" 
    67             destdir="build/${version}/classes" 
    68             source="1.5" target="1.5"
    69             classpath="${cp}"
    70         />
    71     </target>
    72 </project>