samples/insertsuperclass/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:50:57 +0200
changeset 12 711145230748
child 14 a550cb168ce1
permissions -rw-r--r--
Adding interface or class into hierarchy is backward compatible
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@12
     6
    
jtulach@12
     7
    <target name="build">
jtulach@12
     8
        <antcall target="-build-one">
jtulach@12
     9
            <param name="version" value="api1.0"/>
jtulach@12
    10
        </antcall>
jtulach@12
    11
        <antcall target="-build-one">
jtulach@12
    12
            <param name="version" value="api2.0"/>
jtulach@12
    13
        </antcall>
jtulach@12
    14
        <echo level="info" message="Compiling the Implementation against Version 1.0 of the API. This should succeeds."/>
jtulach@12
    15
        <antcall target="-build-one">
jtulach@12
    16
            <param name="version" value="impl"/>
jtulach@12
    17
            <param name="cp" location="build/api1.0/classes"/>
jtulach@12
    18
        </antcall>
jtulach@12
    19
    </target>
jtulach@12
    20
    
jtulach@12
    21
    <target name="run" depends="build">
jtulach@12
    22
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
jtulach@12
    23
        <antcall target="-run-one">
jtulach@12
    24
            <param name="version" value="api1.0"/>
jtulach@12
    25
        </antcall>
jtulach@12
    26
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeeds."/>
jtulach@12
    27
        <antcall target="-run-one">
jtulach@12
    28
            <param name="version" value="api2.0"/>
jtulach@12
    29
        </antcall>
jtulach@12
    30
    </target>
jtulach@12
    31
jtulach@12
    32
    
jtulach@12
    33
    <!-- support methods -->
jtulach@12
    34
    
jtulach@12
    35
    <target name="-run-one">
jtulach@12
    36
        <fail message="You need to specify API version number" unless="version"/>
jtulach@12
    37
        <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Main"
jtulach@12
    38
            failonerror="true"
jtulach@12
    39
        />
jtulach@12
    40
    </target>
jtulach@12
    41
    
jtulach@12
    42
    <target name="-build-one">
jtulach@12
    43
        <fail message="You need to specify version number" unless="version"/>
jtulach@12
    44
        
jtulach@12
    45
        <mkdir dir="build/${version}/classes"/>
jtulach@12
    46
        <property name="cp" value=""/>
jtulach@12
    47
        <javac 
jtulach@12
    48
            srcdir="src-${version}" 
jtulach@12
    49
            destdir="build/${version}/classes" 
jtulach@12
    50
            source="1.5" target="1.5"
jtulach@12
    51
            classpath="${cp}"
jtulach@12
    52
        />
jtulach@12
    53
    </target>
jtulach@12
    54
</project>