samples/messagedigest/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:52:25 +0200
changeset 47 f464a16d553a
parent 44 716af5f2ebd1
child 48 c5742322dbc8
permissions -rw-r--r--
Simplified to does not contain the friend API, instead the SPI is directly define by the API
jtulach@37
     1
<?xml version="1.0" encoding="UTF-8"?>
jtulach@44
     2
<project name="Build Script" default="test" basedir=".">
jtulach@44
     3
    <target name="clean">
jtulach@44
     4
        <delete dir="build"/>
jtulach@44
     5
    </target>
jtulach@44
     6
    
jtulach@44
     7
    <target name="build" depends="-libraries">
jtulach@44
     8
        <antcall target="-build-one">
jtulach@44
     9
            <param name="version" value="new-api"/>
jtulach@44
    10
        </antcall>
jtulach@44
    11
        <antcall target="-build-one">
jtulach@47
    12
            <param name="version" value="bridge"/>
jtulach@44
    13
            <param name="cp" value="build/new-api/classes"/>
jtulach@44
    14
        </antcall>
jtulach@44
    15
        
jtulach@44
    16
        <antcall target="-build-one">
jtulach@44
    17
            <param name="version" value="test"/>
jtulach@47
    18
            <param name="cp" value="build/new-api/classes:${junit.jar}"/>
jtulach@44
    19
        </antcall>
jtulach@44
    20
    </target>
jtulach@44
    21
    
jtulach@44
    22
    <target name="test" depends="build">
jtulach@44
    23
        <echo level="info" message="Running the tests with bridge enabled. This should succeeds."/>
jtulach@44
    24
        <antcall target="-run-one">
jtulach@47
    25
            <param name="test.cp" value="build/new-api/classes:build/bridge/classes"/>
jtulach@44
    26
        </antcall>
jtulach@44
    27
        <echo level="info" message="Running the tests without bridge module. This should fail."/>
jtulach@44
    28
        <antcall target="-run-one">
jtulach@47
    29
            <param name="test.cp" value="build/new-api/classes"/>
jtulach@44
    30
        </antcall>
jtulach@44
    31
    </target>
jtulach@44
    32
    
jtulach@44
    33
    <!-- support methods -->
jtulach@44
    34
    
jtulach@44
    35
    <target name="-libraries">
jtulach@44
    36
        <ant dir="../libs/"/>
jtulach@44
    37
        
jtulach@44
    38
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@44
    39
    </target>
jtulach@44
    40
    
jtulach@44
    41
    <target name="-run-one">
jtulach@44
    42
        <mkdir dir="build/testresults"/>
jtulach@44
    43
        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@44
    44
            <batchtest todir="build/testresults">
jtulach@44
    45
                <fileset dir="build/test/classes">
jtulach@44
    46
                    <filename name="**/*Test.class"/>
jtulach@44
    47
                </fileset>
jtulach@44
    48
            </batchtest>
jtulach@44
    49
            <classpath>
jtulach@44
    50
                <path path="${test.cp}"/>
jtulach@44
    51
                <path location="build/test/classes"/>
jtulach@44
    52
                <path location="${junit.jar}"/>
jtulach@44
    53
            </classpath>
jtulach@44
    54
            <formatter type="brief" usefile="false"/>
jtulach@44
    55
            <formatter type="xml"/>
jtulach@44
    56
        </junit>
jtulach@44
    57
    </target>
jtulach@44
    58
    
jtulach@44
    59
    <target name="-build-one">
jtulach@44
    60
        <fail message="You need to specify version number" unless="version"/>
jtulach@44
    61
        
jtulach@44
    62
        <mkdir dir="build/${version}/classes"/>
jtulach@44
    63
        <property name="cp" value=""/>
jtulach@44
    64
        <javac 
jtulach@44
    65
            srcdir="src-${version}" 
jtulach@44
    66
            destdir="build/${version}/classes" 
jtulach@44
    67
            source="1.5" target="1.5"
jtulach@44
    68
            classpath="${cp}"
jtulach@44
    69
        />
jtulach@44
    70
        <copy todir="build/${version}/classes">
jtulach@44
    71
            <fileset dir="src-${version}">
jtulach@44
    72
                <exclude name="**/*.java"/>
jtulach@44
    73
            </fileset>
jtulach@44
    74
        </copy>
jtulach@44
    75
    </target>
jtulach@37
    76
</project>