samples/insertsuperclass/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 18:51:38 +0200
changeset 263 7e8e995065c5
parent 128 8ef997796d0a
child 277 34370a93db6b
permissions -rw-r--r--
Tests of all modules are executed and can fail the build
jtulach@12
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@12
     2
<project name="insertsuperclass" default="run" basedir=".">
jtulach@12
     3
    <target name="clean">
jtulach@12
     4
        <delete dir="build"/>
jtulach@12
     5
    </target>
jtulach@263
     6
    <target name="test"/>
jtulach@12
     7
    
jtulach@128
     8
    <target name="compile" depends="build"/>
jtulach@12
     9
    <target name="build">
jtulach@12
    10
        <antcall target="-build-one">
jtulach@12
    11
            <param name="version" value="api1.0"/>
jtulach@12
    12
        </antcall>
jtulach@12
    13
        <antcall target="-build-one">
jtulach@12
    14
            <param name="version" value="api2.0"/>
jtulach@12
    15
        </antcall>
jtulach@14
    16
        <echo level="info" message="Compiling the Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@12
    17
        <antcall target="-build-one">
jtulach@12
    18
            <param name="version" value="impl"/>
jtulach@12
    19
            <param name="cp" location="build/api1.0/classes"/>
jtulach@12
    20
        </antcall>
jtulach@12
    21
    </target>
jtulach@12
    22
    
jtulach@12
    23
    <target name="run" depends="build">
jtulach@14
    24
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@12
    25
        <antcall target="-run-one">
jtulach@12
    26
            <param name="version" value="api1.0"/>
jtulach@12
    27
        </antcall>
jtulach@14
    28
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
jtulach@12
    29
        <antcall target="-run-one">
jtulach@12
    30
            <param name="version" value="api2.0"/>
jtulach@12
    31
        </antcall>
jtulach@12
    32
    </target>
jtulach@12
    33
jtulach@12
    34
    
jtulach@12
    35
    <!-- support methods -->
jtulach@12
    36
    
jtulach@12
    37
    <target name="-run-one">
jtulach@12
    38
        <fail message="You need to specify API version number" unless="version"/>
jtulach@12
    39
        <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Main"
jtulach@12
    40
            failonerror="true"
jtulach@12
    41
        />
jtulach@12
    42
    </target>
jtulach@12
    43
    
jtulach@12
    44
    <target name="-build-one">
jtulach@12
    45
        <fail message="You need to specify version number" unless="version"/>
jtulach@12
    46
        
jtulach@12
    47
        <mkdir dir="build/${version}/classes"/>
jtulach@12
    48
        <property name="cp" value=""/>
jtulach@12
    49
        <javac 
jtulach@12
    50
            srcdir="src-${version}" 
jtulach@12
    51
            destdir="build/${version}/classes" 
jtulach@12
    52
            source="1.5" target="1.5"
jtulach@12
    53
            classpath="${cp}"
jtulach@12
    54
        />
jtulach@12
    55
    </target>
jtulach@12
    56
</project>