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