samples/genericconstructor/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:57:18 +0200
changeset 146 afad3bdb7bce
parent 142 e220ab4a7afa
child 263 7e8e995065c5
permissions -rw-r--r--
Improved to look better in the book code sample
jtulach@142
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@142
     2
<project name="incompatibilities" default="run" basedir=".">
jtulach@142
     3
    <target name="clean">
jtulach@142
     4
        <delete dir="build"/>
jtulach@142
     5
    </target>
jtulach@142
     6
    
jtulach@142
     7
    <target name="compile" depends="build"/>
jtulach@142
     8
    <target name="build" depends="clean">
jtulach@142
     9
        <echo level="info" message="Compiles with 1.4"/>
jtulach@142
    10
        <antcall target="-build-one">
jtulach@142
    11
            <param name="version" value="plain"/>
jtulach@142
    12
            <param name="source" value="1.4"/>
jtulach@142
    13
        </antcall>
jtulach@146
    14
        <echo level="info" message="Compiles with 1.5, fails as there is now cast"/>
jtulach@146
    15
        <antcall target="-build-one">
jtulach@146
    16
            <param name="version" value="generics"/>
jtulach@146
    17
            <param name="source" value="1.5"/>
jtulach@146
    18
        </antcall>
jtulach@142
    19
        <echo level="info" message="Compiles with 1.5"/>
jtulach@142
    20
        <antcall target="-build-one">
jtulach@146
    21
            <param name="version" value="factory"/>
jtulach@142
    22
            <param name="source" value="1.5"/>
jtulach@142
    23
        </antcall>
jtulach@142
    24
    </target>
jtulach@142
    25
    
jtulach@142
    26
    <!-- support methods -->
jtulach@142
    27
    
jtulach@142
    28
    <target name="-build-one">
jtulach@142
    29
        <fail message="You need to specify version number" unless="version"/>
jtulach@142
    30
        <fail message="You need to specify source number" unless="source"/>
jtulach@142
    31
        
jtulach@142
    32
        <property name="target" value="${version}"/>
jtulach@142
    33
        <mkdir dir="build/${target}/classes"/>
jtulach@142
    34
        <javac 
jtulach@142
    35
            srcdir="src-${version}" 
jtulach@142
    36
            destdir="build/${target}/classes" 
jtulach@142
    37
            source="${source}" target="${source}"
jtulach@142
    38
            classpath="${cp}"
jtulach@142
    39
            failonerror="false"
jtulach@146
    40
        >
jtulach@146
    41
            <compilerarg value="-Xlint:unchecked"/>
jtulach@146
    42
        </javac>
jtulach@142
    43
    </target>
jtulach@142
    44
</project>