samples/genericconstructor/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:57:11 +0200
changeset 142 e220ab4a7afa
child 146 afad3bdb7bce
permissions -rw-r--r--
Example showing that factory methods have greater flexibility when typing with generics
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@142
    14
        <echo level="info" message="Compiles with 1.5"/>
jtulach@142
    15
        <antcall target="-build-one">
jtulach@142
    16
            <param name="version" value="generics"/>
jtulach@142
    17
            <param name="source" value="1.5"/>
jtulach@142
    18
        </antcall>
jtulach@142
    19
    </target>
jtulach@142
    20
    
jtulach@142
    21
    <!-- support methods -->
jtulach@142
    22
    
jtulach@142
    23
    <target name="-build-one">
jtulach@142
    24
        <fail message="You need to specify version number" unless="version"/>
jtulach@142
    25
        <fail message="You need to specify source number" unless="source"/>
jtulach@142
    26
        
jtulach@142
    27
        <property name="target" value="${version}"/>
jtulach@142
    28
        <mkdir dir="build/${target}/classes"/>
jtulach@142
    29
        <javac 
jtulach@142
    30
            srcdir="src-${version}" 
jtulach@142
    31
            destdir="build/${target}/classes" 
jtulach@142
    32
            source="${source}" target="${source}"
jtulach@142
    33
            classpath="${cp}"
jtulach@142
    34
            failonerror="false"
jtulach@142
    35
        />
jtulach@142
    36
    </target>
jtulach@142
    37
</project>