samples/insertsuperclass/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 20:46:27 +0100
changeset 408 9a439a79c6d0
parent 278 c15f77497f6a
permissions -rw-r--r--
Use scala 2.10.4 to compile on JDK8
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@277
     6
    <target name="test" depends="run"/>
jtulach@12
     7
    
jtulach@128
     8
    <target name="compile" depends="build"/>
jtulach@12
     9
    <target name="build">
jtulach@12
    10
        <antcall target="-build-one">
jtulach@12
    11
            <param name="version" value="api1.0"/>
jtulach@12
    12
        </antcall>
jtulach@12
    13
        <antcall target="-build-one">
jtulach@12
    14
            <param name="version" value="api2.0"/>
jtulach@12
    15
        </antcall>
jtulach@14
    16
        <echo level="info" message="Compiling the Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@12
    17
        <antcall target="-build-one">
jtulach@12
    18
            <param name="version" value="impl"/>
jtulach@12
    19
            <param name="cp" location="build/api1.0/classes"/>
jtulach@12
    20
        </antcall>
jtulach@12
    21
    </target>
jtulach@12
    22
    
jtulach@12
    23
    <target name="run" depends="build">
jtulach@14
    24
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeed."/>
jtulach@12
    25
        <antcall target="-run-one">
jtulach@12
    26
            <param name="version" value="api1.0"/>
jtulach@12
    27
        </antcall>
jtulach@14
    28
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should succeed."/>
jtulach@12
    29
        <antcall target="-run-one">
jtulach@12
    30
            <param name="version" value="api2.0"/>
jtulach@12
    31
        </antcall>
jtulach@12
    32
    </target>
jtulach@12
    33
jtulach@12
    34
    
jtulach@12
    35
    <!-- support methods -->
jtulach@12
    36
    
jtulach@12
    37
    <target name="-run-one">
jtulach@12
    38
        <fail message="You need to specify API version number" unless="version"/>
jtulach@278
    39
        <java classpath="build/${version}/classes:build/impl/classes" classname="org.apidesign.insertsuperclass.test.Main"
jtulach@279
    40
            failonerror="true" fork="true">
jtulach@277
    41
            <jvmarg value="-ea"/>
jtulach@277
    42
        </java>
jtulach@12
    43
    </target>
jtulach@12
    44
    
jtulach@12
    45
    <target name="-build-one">
jtulach@12
    46
        <fail message="You need to specify version number" unless="version"/>
jtulach@12
    47
        
jtulach@12
    48
        <mkdir dir="build/${version}/classes"/>
jtulach@12
    49
        <property name="cp" value=""/>
jtulach@12
    50
        <javac 
jtulach@12
    51
            srcdir="src-${version}" 
jtulach@12
    52
            destdir="build/${version}/classes" 
jtulach@12
    53
            source="1.5" target="1.5"
jtulach@12
    54
            classpath="${cp}"
jtulach@277
    55
            debug="true"
jtulach@12
    56
        />
jtulach@12
    57
    </target>
jtulach@12
    58
</project>