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