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
jtulach@65
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@65
     2
<project name="Build Script" default="test" basedir=".">
jtulach@65
     3
    <target name="clean">
jtulach@65
     4
        <delete dir="build"/>
jtulach@65
     5
    </target>
jtulach@65
     6
    
jtulach@128
     7
    <target name="compile" depends="build"/>
jtulach@65
     8
    <target name="build" depends="-libraries">
jtulach@65
     9
        <antcall target="-build-one">
jtulach@65
    10
            <param name="version" value="api1.0"/>
jtulach@65
    11
        </antcall>
jtulach@65
    12
        <antcall target="-build-one">
jtulach@65
    13
            <param name="version" value="api2.0"/>
jtulach@65
    14
        </antcall>
jtulach@65
    15
        
jtulach@65
    16
        <antcall target="-build-one">
jtulach@66
    17
            <param name="version" value="test1.0"/>
jtulach@65
    18
            <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
jtulach@65
    19
        </antcall>
jtulach@66
    20
jtulach@66
    21
        <antcall target="-build-one">
jtulach@66
    22
            <param name="version" value="test2.0"/>
jtulach@66
    23
            <param name="cp" value="build/api2.0/classes:${junit.jar}"/>
jtulach@66
    24
        </antcall>
jtulach@65
    25
    </target>
jtulach@65
    26
    
jtulach@65
    27
    <target name="test" depends="build">
jtulach@66
    28
        <echo level="info" message="Running the Old Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@65
    29
        <antcall target="-run-one">
jtulach@65
    30
            <param name="version" value="api1.0"/>
jtulach@65
    31
        </antcall>
jtulach@66
    32
        <echo level="info" message="Running the Old Implementation against Version 2.0 of the API. This should succeed."/>
jtulach@65
    33
        <antcall target="-run-one">
jtulach@65
    34
            <param name="version" value="api2.0"/>
jtulach@65
    35
        </antcall>
jtulach@66
    36
        <echo level="info" message="Running the New Implementation against Version 2.0 of the API. This should succeed."/>
jtulach@66
    37
        <antcall target="-run-two">
jtulach@66
    38
            <param name="version" value="api2.0"/>
jtulach@66
    39
        </antcall>
jtulach@65
    40
    </target>
jtulach@65
    41
    
jtulach@65
    42
    <!-- support methods -->
jtulach@65
    43
    
jtulach@65
    44
    <target name="-libraries">
jtulach@65
    45
        <ant dir="../libs/"/>
jtulach@65
    46
        
jtulach@65
    47
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@65
    48
    </target>
jtulach@65
    49
    
jtulach@65
    50
    <target name="-run-one">
jtulach@65
    51
        <fail message="You need to specify API version number" unless="version"/>
jtulach@65
    52
        <mkdir dir="build/testresults"/>
jtulach@66
    53
        <junit dir="build/test1.0/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@65
    54
            <batchtest todir="build/testresults">
jtulach@66
    55
                <fileset dir="build/test1.0/classes">
jtulach@65
    56
                    <filename name="**/*Test.class"/>
jtulach@65
    57
                </fileset>
jtulach@65
    58
            </batchtest>
jtulach@65
    59
            <classpath>
jtulach@65
    60
                <path location="build/${version}/classes"/>
jtulach@66
    61
                <path location="build/test1.0/classes"/>
jtulach@66
    62
                <path location="${junit.jar}"/>
jtulach@66
    63
            </classpath>
jtulach@66
    64
            <formatter type="brief" usefile="false"/>
jtulach@66
    65
            <formatter type="xml"/>
jtulach@66
    66
        </junit>
jtulach@66
    67
    </target>
jtulach@66
    68
jtulach@66
    69
    <target name="-run-two">
jtulach@66
    70
        <fail message="You need to specify API version number" unless="version"/>
jtulach@66
    71
        <mkdir dir="build/testresults"/>
jtulach@66
    72
        <junit dir="build/test2.0/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@66
    73
            <batchtest todir="build/testresults">
jtulach@66
    74
                <fileset dir="build/test2.0/classes">
jtulach@66
    75
                    <filename name="**/*Test.class"/>
jtulach@66
    76
                </fileset>
jtulach@66
    77
            </batchtest>
jtulach@66
    78
            <classpath>
jtulach@66
    79
                <path location="build/${version}/classes"/>
jtulach@66
    80
                <path location="build/test2.0/classes"/>
jtulach@65
    81
                <path location="${junit.jar}"/>
jtulach@65
    82
            </classpath>
jtulach@65
    83
            <formatter type="brief" usefile="false"/>
jtulach@65
    84
            <formatter type="xml"/>
jtulach@65
    85
        </junit>
jtulach@65
    86
    </target>
jtulach@65
    87
    
jtulach@65
    88
    <target name="-build-one">
jtulach@65
    89
        <fail message="You need to specify version number" unless="version"/>
jtulach@65
    90
        
jtulach@65
    91
        <mkdir dir="build/${version}/classes"/>
jtulach@65
    92
        <property name="cp" value=""/>
jtulach@65
    93
        <javac 
jtulach@65
    94
            srcdir="src-${version}" 
jtulach@65
    95
            destdir="build/${version}/classes" 
jtulach@65
    96
            source="1.5" target="1.5"
jtulach@65
    97
            classpath="${cp}"
jtulach@65
    98
        />
jtulach@65
    99
    </target>
jtulach@65
   100
</project>