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