samples/instanceofclass/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 03 Apr 2020 16:32:36 +0200
changeset 416 9ed8788a1a4e
parent 128 8ef997796d0a
permissions -rw-r--r--
Using HTTPS to download the libraries
jtulach@75
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@75
     2
<project name="instanceofclass" default="run" basedir=".">
jtulach@75
     3
    <target name="clean">
jtulach@75
     4
        <delete dir="build"/>
jtulach@75
     5
    </target>
jtulach@263
     6
    <target name="test"/>
jtulach@75
     7
    
jtulach@128
     8
    <target name="compile" depends="build"/>
jtulach@75
     9
    <target name="build">
jtulach@75
    10
        <antcall target="-build-one">
jtulach@75
    11
            <param name="version" value="api1.0"/>
jtulach@75
    12
        </antcall>
jtulach@75
    13
        <antcall target="-build-one">
jtulach@75
    14
            <param name="version" value="api2.0"/>
jtulach@75
    15
        </antcall>
jtulach@75
    16
    </target>
jtulach@75
    17
    
jtulach@75
    18
    <target name="run" depends="build">
jtulach@75
    19
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@75
    20
        <antcall target="-run-one">
jtulach@75
    21
            <param name="version" value="api1.0"/>
jtulach@75
    22
        </antcall>
jtulach@75
    23
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
jtulach@75
    24
        <antcall target="-run-one">
jtulach@75
    25
            <param name="version" value="api2.0"/>
jtulach@75
    26
        </antcall>
jtulach@75
    27
    </target>
jtulach@75
    28
jtulach@75
    29
    
jtulach@75
    30
    <!-- support methods -->
jtulach@75
    31
    
jtulach@75
    32
    <target name="-run-one">
jtulach@75
    33
        <fail message="You need to specify API version number" unless="version"/>
jtulach@75
    34
        <java classpath="build/${version}/classes:build/impl/classes" classname="impl.Main"
jtulach@75
    35
            failonerror="true"
jtulach@75
    36
        />
jtulach@75
    37
    </target>
jtulach@75
    38
    
jtulach@75
    39
    <target name="-build-one">
jtulach@75
    40
        <fail message="You need to specify version number" unless="version"/>
jtulach@75
    41
        
jtulach@75
    42
        <mkdir dir="build/${version}/classes"/>
jtulach@75
    43
        <property name="cp" value=""/>
jtulach@75
    44
        <javac 
jtulach@75
    45
            srcdir="src-${version}" 
jtulach@75
    46
            destdir="build/${version}/classes" 
jtulach@75
    47
            source="1.5" target="1.5"
jtulach@75
    48
            classpath="${cp}"
jtulach@75
    49
        />
jtulach@75
    50
    </target>
jtulach@75
    51
</project>