samples/composition/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:05 +0200
changeset 21 0aee50e597da
parent 19 56735848fe6c
child 119 8147cafd007a
permissions -rw-r--r--
Really downloading junit from their site
jtulach@15
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@17
     2
<project name="Build Script" default="test" basedir=".">
jtulach@17
     3
    <target name="clean">
jtulach@17
     4
        <delete dir="build"/>
jtulach@17
     5
    </target>
jtulach@17
     6
    
jtulach@21
     7
    <target name="build" depends="-libraries">
jtulach@17
     8
        <antcall target="-build-one">
jtulach@17
     9
            <param name="version" value="api1.0"/>
jtulach@17
    10
        </antcall>
jtulach@17
    11
        <antcall target="-build-one">
jtulach@17
    12
            <param name="version" value="api2.0"/>
jtulach@17
    13
        </antcall>
jtulach@17
    14
        
jtulach@17
    15
        <antcall target="-build-one">
jtulach@17
    16
            <param name="version" value="test"/>
jtulach@21
    17
            <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
jtulach@17
    18
        </antcall>
jtulach@17
    19
    </target>
jtulach@17
    20
    
jtulach@17
    21
    <target name="test" depends="build">
jtulach@17
    22
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
jtulach@17
    23
        <antcall target="-run-one">
jtulach@17
    24
            <param name="version" value="api1.0"/>
jtulach@17
    25
        </antcall>
jtulach@17
    26
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
jtulach@17
    27
        <antcall target="-run-one">
jtulach@17
    28
            <param name="version" value="api2.0"/>
jtulach@17
    29
        </antcall>
jtulach@17
    30
    </target>
jtulach@17
    31
    
jtulach@17
    32
    <!-- support methods -->
jtulach@17
    33
    
jtulach@21
    34
    <target name="-libraries">
jtulach@21
    35
        <ant dir="../libs/"/>
jtulach@21
    36
        
jtulach@21
    37
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@21
    38
    </target>
jtulach@21
    39
    
jtulach@17
    40
    <target name="-run-one">
jtulach@17
    41
        <fail message="You need to specify API version number" unless="version"/>
jtulach@19
    42
        <mkdir dir="build/testresults"/>
jtulach@19
    43
        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@19
    44
            <batchtest todir="build/testresults">
jtulach@19
    45
                <fileset dir="build/test/classes">
jtulach@19
    46
                    <filename name="**/*Test.class"/>
jtulach@19
    47
                </fileset>
jtulach@19
    48
            </batchtest>
jtulach@19
    49
            <classpath>
jtulach@19
    50
                <path location="build/${version}/classes"/>
jtulach@19
    51
                <path location="build/test/classes"/>
jtulach@21
    52
                <path location="${junit.jar}"/>
jtulach@19
    53
            </classpath>
jtulach@19
    54
            <formatter type="brief" usefile="false"/>
jtulach@19
    55
            <formatter type="xml"/>
jtulach@19
    56
        </junit>
jtulach@17
    57
    </target>
jtulach@17
    58
    
jtulach@17
    59
    <target name="-build-one">
jtulach@17
    60
        <fail message="You need to specify version number" unless="version"/>
jtulach@17
    61
        
jtulach@17
    62
        <mkdir dir="build/${version}/classes"/>
jtulach@17
    63
        <property name="cp" value=""/>
jtulach@17
    64
        <javac 
jtulach@17
    65
            srcdir="src-${version}" 
jtulach@17
    66
            destdir="build/${version}/classes" 
jtulach@17
    67
            source="1.5" target="1.5"
jtulach@17
    68
            classpath="${cp}"
jtulach@17
    69
        />
jtulach@17
    70
    </target>
jtulach@15
    71
</project>