author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Thu, 30 Oct 2014 20:46:27 +0100 | |
changeset 408 | 9a439a79c6d0 |
parent 183 | e9f4bdb6a3f4 |
permissions | -rw-r--r-- |
jtulach@183 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
jtulach@183 | 2 |
<project name="Build Script" default="test" basedir="."> |
jtulach@183 | 3 |
<target name="clean"> |
jtulach@183 | 4 |
<delete dir="build"/> |
jtulach@183 | 5 |
</target> |
jtulach@183 | 6 |
<target name="compile" depends="build"/> |
jtulach@183 | 7 |
<target name="build" depends="-libraries"> |
jtulach@183 | 8 |
<antcall target="-build-one"> |
jtulach@183 | 9 |
<param name="version" value="api1.0"/> |
jtulach@183 | 10 |
</antcall> |
jtulach@183 | 11 |
<antcall target="-build-one"> |
jtulach@183 | 12 |
<param name="version" value="api2.0"/> |
jtulach@183 | 13 |
</antcall> |
jtulach@183 | 14 |
<antcall target="-build-one"> |
jtulach@183 | 15 |
<param name="version" value="api3.0"/> |
jtulach@183 | 16 |
</antcall> |
jtulach@183 | 17 |
<antcall target="-build-one"> |
jtulach@183 | 18 |
<param name="version" value="test"/> |
jtulach@183 | 19 |
<param name="cp" value="build/api1.0/classes:${junit.jar}"/> |
jtulach@183 | 20 |
</antcall> |
jtulach@183 | 21 |
<antcall target="-build-one"> |
jtulach@183 | 22 |
<param name="version" value="test2.0"/> |
jtulach@183 | 23 |
<param name="cp" value="build/api2.0/classes:build/test/classes:${junit.jar}"/> |
jtulach@183 | 24 |
</antcall> |
jtulach@183 | 25 |
<antcall target="-build-one"> |
jtulach@183 | 26 |
<param name="version" value="test3.0"/> |
jtulach@183 | 27 |
<param name="cp" value="build/api3.0/classes:build/test/classes:build/test2.0/classes:${junit.jar}"/> |
jtulach@183 | 28 |
</antcall> |
jtulach@183 | 29 |
</target> |
jtulach@183 | 30 |
<target name="test" depends="build"> |
jtulach@183 | 31 |
<echo level="info" message="PrintVisitor on old API. This should succeeds."/> |
jtulach@183 | 32 |
<antcall target="-run-one"> |
jtulach@183 | 33 |
<param name="version" value="api1.0"/> |
jtulach@183 | 34 |
</antcall> |
jtulach@183 | 35 |
<echo level="info" message="PrintVisitor on old API. This would not compile, but it runs as it does not deal with minus at all."/> |
jtulach@183 | 36 |
<antcall target="-run-one"> |
jtulach@183 | 37 |
<param name="version" value="api2.0"/> |
jtulach@183 | 38 |
</antcall> |
jtulach@183 | 39 |
<echo level="info" message="PrintVisitor on new API. This yields runtime error."/> |
jtulach@183 | 40 |
<antcall target="-run-one"> |
jtulach@183 | 41 |
<param name="test" value="test2.0"/> |
jtulach@183 | 42 |
<param name="extra.cp" value="build/test/classes"/> |
jtulach@183 | 43 |
<param name="version" value="api2.0"/> |
jtulach@183 | 44 |
</antcall> |
jtulach@183 | 45 |
<echo level="info" message="Using old Number with new visitors"/> |
jtulach@183 | 46 |
<antcall target="-run-one"> |
jtulach@183 | 47 |
<param name="test" value="test3.0"/> |
jtulach@183 | 48 |
<param name="extra.cp" value="build/test/classes:build/test2.0/classes:"/> |
jtulach@183 | 49 |
<param name="version" value="api3.0"/> |
jtulach@183 | 50 |
</antcall> |
jtulach@183 | 51 |
</target> |
jtulach@183 | 52 |
|
jtulach@183 | 53 |
<!-- support methods --> |
jtulach@183 | 54 |
<target name="-libraries"> |
jtulach@183 | 55 |
<ant dir="../../libs/"/> |
jtulach@183 | 56 |
<property name="junit.jar" location="../../libs/dist/junit-4.4.jar"/> |
jtulach@183 | 57 |
</target> |
jtulach@183 | 58 |
<target name="-run-one"> |
jtulach@183 | 59 |
<fail message="You need to specify API version number" unless="version"/> |
jtulach@183 | 60 |
<property name="test" value="test"/> |
jtulach@183 | 61 |
<mkdir dir="build/${test}results${version}"/> |
jtulach@183 | 62 |
<junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true"> |
jtulach@183 | 63 |
<batchtest todir="build/${test}results${version}"> |
jtulach@183 | 64 |
<fileset dir="build/${test}/classes"> |
jtulach@183 | 65 |
<filename name="**/*Test.class"/> |
jtulach@183 | 66 |
</fileset> |
jtulach@183 | 67 |
</batchtest> |
jtulach@183 | 68 |
<classpath> |
jtulach@183 | 69 |
<path location="build/${version}/classes"/> |
jtulach@183 | 70 |
<path location="build/${test}/classes"/> |
jtulach@183 | 71 |
<path location="${junit.jar}"/> |
jtulach@183 | 72 |
<path path="${extra.cp}"/> |
jtulach@183 | 73 |
</classpath> |
jtulach@265 | 74 |
<syspropertyset> |
jtulach@265 | 75 |
<propertyref prefix="test-sys-prop."/> |
jtulach@265 | 76 |
<mapper from="test-sys-prop.*" to="*" type="glob"/> |
jtulach@265 | 77 |
</syspropertyset> |
jtulach@183 | 78 |
<formatter type="brief" usefile="false"/> |
jtulach@183 | 79 |
<formatter type="xml"/> |
jtulach@183 | 80 |
</junit> |
jtulach@183 | 81 |
</target> |
jtulach@183 | 82 |
<target name="-build-one"> |
jtulach@183 | 83 |
<fail message="You need to specify version number" unless="version"/> |
jtulach@183 | 84 |
<property name="cp" value=""/> |
jtulach@183 | 85 |
<property name="out" value="${version}"/> |
jtulach@183 | 86 |
<property name="failonerror" value="true"/> |
jtulach@183 | 87 |
<mkdir dir="build/${out}/classes"/> |
jtulach@183 | 88 |
<javac |
jtulach@183 | 89 |
srcdir="src-${version}" |
jtulach@183 | 90 |
destdir="build/${out}/classes" |
jtulach@183 | 91 |
source="1.5" target="1.5" |
jtulach@183 | 92 |
classpath="${cp}" |
jtulach@183 | 93 |
failonerror="${failonerror}" |
jtulach@265 | 94 |
debug="true" |
jtulach@183 | 95 |
/> |
jtulach@183 | 96 |
</target> |
jtulach@183 | 97 |
</project> |