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