samples/delegatingwriterfinal/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:53:06 +0200
changeset 65 4db7ceebd2b3
child 66 8379bb7c0dff
permissions -rw-r--r--
Nonsubclassable Writer example
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@65
    16
            <param name="version" value="test"/>
jtulach@65
    17
            <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
jtulach@65
    18
        </antcall>
jtulach@65
    19
    </target>
jtulach@65
    20
    
jtulach@65
    21
    <target name="test" depends="build">
jtulach@65
    22
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
jtulach@65
    23
        <antcall target="-run-one">
jtulach@65
    24
            <param name="version" value="api1.0"/>
jtulach@65
    25
        </antcall>
jtulach@65
    26
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
jtulach@65
    27
        <antcall target="-run-one">
jtulach@65
    28
            <param name="version" value="api2.0"/>
jtulach@65
    29
        </antcall>
jtulach@65
    30
    </target>
jtulach@65
    31
    
jtulach@65
    32
    <!-- support methods -->
jtulach@65
    33
    
jtulach@65
    34
    <target name="-libraries">
jtulach@65
    35
        <ant dir="../libs/"/>
jtulach@65
    36
        
jtulach@65
    37
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@65
    38
    </target>
jtulach@65
    39
    
jtulach@65
    40
    <target name="-run-one">
jtulach@65
    41
        <fail message="You need to specify API version number" unless="version"/>
jtulach@65
    42
        <mkdir dir="build/testresults"/>
jtulach@65
    43
        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@65
    44
            <batchtest todir="build/testresults">
jtulach@65
    45
                <fileset dir="build/test/classes">
jtulach@65
    46
                    <filename name="**/*Test.class"/>
jtulach@65
    47
                </fileset>
jtulach@65
    48
            </batchtest>
jtulach@65
    49
            <classpath>
jtulach@65
    50
                <path location="build/${version}/classes"/>
jtulach@65
    51
                <path location="build/test/classes"/>
jtulach@65
    52
                <path location="${junit.jar}"/>
jtulach@65
    53
            </classpath>
jtulach@65
    54
            <formatter type="brief" usefile="false"/>
jtulach@65
    55
            <formatter type="xml"/>
jtulach@65
    56
        </junit>
jtulach@65
    57
    </target>
jtulach@65
    58
    
jtulach@65
    59
    <target name="-build-one">
jtulach@65
    60
        <fail message="You need to specify version number" unless="version"/>
jtulach@65
    61
        
jtulach@65
    62
        <mkdir dir="build/${version}/classes"/>
jtulach@65
    63
        <property name="cp" value=""/>
jtulach@65
    64
        <javac 
jtulach@65
    65
            srcdir="src-${version}" 
jtulach@65
    66
            destdir="build/${version}/classes" 
jtulach@65
    67
            source="1.5" target="1.5"
jtulach@65
    68
            classpath="${cp}"
jtulach@65
    69
        />
jtulach@65
    70
    </target>
jtulach@65
    71
</project>