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