samples/messagedigest/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:55:09 +0200
changeset 128 8ef997796d0a
parent 127 07696c62f340
child 263 7e8e995065c5
permissions -rw-r--r--
Merge: Patrick's fixes
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@128
     7
    <target name="compile" depends="build"/>
jtulach@44
     8
    <target name="build" depends="-libraries">
jtulach@44
     9
        <antcall target="-build-one">
jtulach@44
    10
            <param name="version" value="new-api"/>
jtulach@44
    11
        </antcall>
jtulach@44
    12
        <antcall target="-build-one">
jtulach@51
    13
            <param name="version" value="bridge"/>
jtulach@50
    14
            <param name="cp" value="build/new-api/classes"/>
jtulach@50
    15
        </antcall>
jtulach@44
    16
        
jtulach@44
    17
        <antcall target="-build-one">
jtulach@44
    18
            <param name="version" value="test"/>
jtulach@51
    19
            <param name="cp" value="build/new-api/classes:${junit.jar}"/>
jtulach@44
    20
        </antcall>
jtulach@44
    21
    </target>
jtulach@44
    22
    
jtulach@51
    23
    <target name="test">
jtulach@51
    24
        <antcall target="-do-test">
jtulach@51
    25
            <param name="nodebug" value="true"/>
jtulach@51
    26
        </antcall>
jtulach@51
    27
    </target>
jtulach@51
    28
        
jtulach@51
    29
    <target name="-do-test" depends="build">
jtulach@44
    30
        <echo level="info" message="Running the tests with bridge enabled. This should succeeds."/>
jtulach@44
    31
        <antcall target="-run-one">
jtulach@51
    32
            <param name="test.cp" value="build/new-api/classes:build/bridge/classes"/>
jtulach@44
    33
        </antcall>
jtulach@44
    34
        <echo level="info" message="Running the tests without bridge module. This should fail."/>
jtulach@44
    35
        <antcall target="-run-one">
jtulach@51
    36
            <param name="test.cp" value="build/new-api/classes"/>
jtulach@44
    37
        </antcall>
jtulach@44
    38
    </target>
jtulach@44
    39
    
jtulach@44
    40
    <!-- support methods -->
jtulach@44
    41
    
jtulach@44
    42
    <target name="-libraries">
jtulach@44
    43
        <ant dir="../libs/"/>
jtulach@44
    44
        
jtulach@44
    45
        <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
jtulach@44
    46
    </target>
jtulach@51
    47
jtulach@51
    48
    <target name="-debug-one" if="netbeans.home" unless="nodebug">
jtulach@51
    49
        <nbjpdastart addressproperty="jpda.address" name="MessageDigest and Bridges" transport="dt_socket" >
jtulach@51
    50
            <sourcepath path="src-new-api:src-bridge:src-test:build/test/classes"/>
jtulach@51
    51
            <classpath path="build/new-api/classes:build/bridge/classes:build/test/classes"/>
jtulach@51
    52
        </nbjpdastart>
jtulach@51
    53
        <property name="debug1" value="-Xdebug"/>
jtulach@51
    54
        <property name="debug2" value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
jtulach@51
    55
    </target>
jtulach@44
    56
    
jtulach@51
    57
    <target name="-run-one" depends="-debug-one">
jtulach@51
    58
        <property name="debug1" value="-Dn1"/>
jtulach@51
    59
        <property name="debug2" value="-Dn2"/>
jtulach@51
    60
        <property name="include" value="**/*Test"/>
jtulach@44
    61
        <mkdir dir="build/testresults"/>
jtulach@44
    62
        <junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
jtulach@44
    63
            <batchtest todir="build/testresults">
jtulach@44
    64
                <fileset dir="build/test/classes">
jtulach@51
    65
                    <filename name="${include}.class"/>
jtulach@44
    66
                </fileset>
jtulach@44
    67
            </batchtest>
jtulach@44
    68
            <classpath>
jtulach@44
    69
                <path path="${test.cp}"/>
jtulach@44
    70
                <path location="build/test/classes"/>
jtulach@44
    71
                <path location="${junit.jar}"/>
jtulach@44
    72
            </classpath>
jtulach@44
    73
            <formatter type="brief" usefile="false"/>
jtulach@44
    74
            <formatter type="xml"/>
jtulach@51
    75
            <jvmarg value="${debug1}"/>
jtulach@51
    76
            <jvmarg value="${debug2}"/>
jtulach@44
    77
        </junit>
jtulach@44
    78
    </target>
jtulach@44
    79
    
jtulach@44
    80
    <target name="-build-one">
jtulach@44
    81
        <fail message="You need to specify version number" unless="version"/>
jtulach@44
    82
        
jtulach@44
    83
        <mkdir dir="build/${version}/classes"/>
jtulach@44
    84
        <property name="cp" value=""/>
jtulach@44
    85
        <javac 
jtulach@44
    86
            srcdir="src-${version}" 
jtulach@44
    87
            destdir="build/${version}/classes" 
jtulach@44
    88
            source="1.5" target="1.5"
jtulach@44
    89
            classpath="${cp}"
jtulach@51
    90
            debug="true" debuglevel="lines,vars,source"
jtulach@44
    91
        />
jtulach@44
    92
        <copy todir="build/${version}/classes">
jtulach@44
    93
            <fileset dir="src-${version}">
jtulach@44
    94
                <exclude name="**/*.java"/>
jtulach@44
    95
            </fileset>
jtulach@44
    96
        </copy>
jtulach@44
    97
    </target>
jtulach@37
    98
</project>