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