samples/delegatingwriterfinal/build.xml
changeset 65 4db7ceebd2b3
child 66 8379bb7c0dff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/delegatingwriterfinal/build.xml	Sat Jun 14 09:53:06 2008 +0200
     1.3 @@ -0,0 +1,71 @@
     1.4 +<?xml version="1.0" encoding="UTF-8"?>
     1.5 +<project name="Build Script" default="test" basedir=".">
     1.6 +    <target name="clean">
     1.7 +        <delete dir="build"/>
     1.8 +    </target>
     1.9 +    
    1.10 +    <target name="build" depends="-libraries">
    1.11 +        <antcall target="-build-one">
    1.12 +            <param name="version" value="api1.0"/>
    1.13 +        </antcall>
    1.14 +        <antcall target="-build-one">
    1.15 +            <param name="version" value="api2.0"/>
    1.16 +        </antcall>
    1.17 +        
    1.18 +        <antcall target="-build-one">
    1.19 +            <param name="version" value="test"/>
    1.20 +            <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
    1.21 +        </antcall>
    1.22 +    </target>
    1.23 +    
    1.24 +    <target name="test" depends="build">
    1.25 +        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
    1.26 +        <antcall target="-run-one">
    1.27 +            <param name="version" value="api1.0"/>
    1.28 +        </antcall>
    1.29 +        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
    1.30 +        <antcall target="-run-one">
    1.31 +            <param name="version" value="api2.0"/>
    1.32 +        </antcall>
    1.33 +    </target>
    1.34 +    
    1.35 +    <!-- support methods -->
    1.36 +    
    1.37 +    <target name="-libraries">
    1.38 +        <ant dir="../libs/"/>
    1.39 +        
    1.40 +        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
    1.41 +    </target>
    1.42 +    
    1.43 +    <target name="-run-one">
    1.44 +        <fail message="You need to specify API version number" unless="version"/>
    1.45 +        <mkdir dir="build/testresults"/>
    1.46 +        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    1.47 +            <batchtest todir="build/testresults">
    1.48 +                <fileset dir="build/test/classes">
    1.49 +                    <filename name="**/*Test.class"/>
    1.50 +                </fileset>
    1.51 +            </batchtest>
    1.52 +            <classpath>
    1.53 +                <path location="build/${version}/classes"/>
    1.54 +                <path location="build/test/classes"/>
    1.55 +                <path location="${junit.jar}"/>
    1.56 +            </classpath>
    1.57 +            <formatter type="brief" usefile="false"/>
    1.58 +            <formatter type="xml"/>
    1.59 +        </junit>
    1.60 +    </target>
    1.61 +    
    1.62 +    <target name="-build-one">
    1.63 +        <fail message="You need to specify version number" unless="version"/>
    1.64 +        
    1.65 +        <mkdir dir="build/${version}/classes"/>
    1.66 +        <property name="cp" value=""/>
    1.67 +        <javac 
    1.68 +            srcdir="src-${version}" 
    1.69 +            destdir="build/${version}/classes" 
    1.70 +            source="1.5" target="1.5"
    1.71 +            classpath="${cp}"
    1.72 +        />
    1.73 +    </target>
    1.74 +</project>