samples/consistency/build.xml
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 30 Oct 2014 21:30:10 +0100
changeset 409 40cabcdcd2be
parent 127 07696c62f340
permissions -rw-r--r--
Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
jtulach@26
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@26
     2
<project name="Build Script" default="test" basedir=".">
jtulach@26
     3
    <target name="clean">
jtulach@26
     4
        <delete dir="build"/>
jtulach@26
     5
    </target>
jtulach@26
     6
    
jtulach@128
     7
    <target name="compile" depends="build"/>
jtulach@26
     8
    <target name="build" depends="-libraries">
jtulach@26
     9
        <antcall target="-build-one">
jtulach@26
    10
            <param name="version" value="api1.0"/>
jtulach@26
    11
        </antcall>
jtulach@26
    12
        <antcall target="-build-one">
jtulach@26
    13
            <param name="version" value="api2.0"/>
jtulach@26
    14
        </antcall>
jtulach@26
    15
        
jtulach@26
    16
        <antcall target="-build-one">
jtulach@26
    17
            <param name="version" value="test"/>
jtulach@26
    18
            <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
jtulach@26
    19
        </antcall>
jtulach@26
    20
    </target>
jtulach@26
    21
    
jtulach@26
    22
    <target name="test" depends="build">
jtulach@26
    23
        <echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/>
jtulach@26
    24
        <antcall target="-run-one">
jtulach@26
    25
            <param name="version" value="api1.0"/>
jtulach@26
    26
        </antcall>
jtulach@26
    27
        <echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/>
jtulach@26
    28
        <antcall target="-run-one">
jtulach@26
    29
            <param name="version" value="api2.0"/>
jtulach@26
    30
        </antcall>
jtulach@26
    31
    </target>
jtulach@26
    32
    
jtulach@26
    33
    <!-- support methods -->
jtulach@26
    34
    
jtulach@26
    35
    <target name="-libraries">
jtulach@26
    36
        <ant dir="../libs/"/>
jtulach@26
    37
        
jtulach@26
    38
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@26
    39
    </target>
jtulach@26
    40
    
jtulach@26
    41
    <target name="-run-one">
jtulach@26
    42
        <fail message="You need to specify API version number" unless="version"/>
jtulach@26
    43
        <mkdir dir="build/testresults"/>
jtulach@26
    44
        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@26
    45
            <batchtest todir="build/testresults">
jtulach@26
    46
                <fileset dir="build/test/classes">
jtulach@26
    47
                    <filename name="**/*Test.class"/>
jtulach@26
    48
                </fileset>
jtulach@26
    49
            </batchtest>
jtulach@26
    50
            <classpath>
jtulach@26
    51
                <path location="build/${version}/classes"/>
jtulach@26
    52
                <path location="build/test/classes"/>
jtulach@26
    53
                <path location="${junit.jar}"/>
jtulach@26
    54
            </classpath>
jtulach@26
    55
            <formatter type="brief" usefile="false"/>
jtulach@26
    56
            <formatter type="xml"/>
jtulach@26
    57
        </junit>
jtulach@26
    58
    </target>
jtulach@26
    59
    
jtulach@26
    60
    <target name="-build-one">
jtulach@26
    61
        <fail message="You need to specify version number" unless="version"/>
jtulach@26
    62
        
jtulach@26
    63
        <mkdir dir="build/${version}/classes"/>
jtulach@26
    64
        <property name="cp" value=""/>
jtulach@26
    65
        <javac 
jtulach@26
    66
            srcdir="src-${version}" 
jtulach@26
    67
            destdir="build/${version}/classes" 
jtulach@26
    68
            source="1.5" target="1.5"
jtulach@26
    69
            classpath="${cp}"
jtulach@26
    70
        />
jtulach@26
    71
    </target>
jtulach@26
    72
</project>