author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Fri, 03 Apr 2020 16:32:36 +0200 | |
changeset 416 | 9ed8788a1a4e |
parent 187 | e8db9f297016 |
permissions | -rw-r--r-- |
jtulach@15 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
jtulach@17 | 2 |
<project name="Build Script" default="test" basedir="."> |
jtulach@17 | 3 |
<target name="clean"> |
jtulach@17 | 4 |
<delete dir="build"/> |
jtulach@17 | 5 |
</target> |
jtulach@17 | 6 |
|
jtulach@128 | 7 |
<target name="compile" depends="build"/> |
jtulach@21 | 8 |
<target name="build" depends="-libraries"> |
jtulach@17 | 9 |
<antcall target="-build-one"> |
jtulach@17 | 10 |
<param name="version" value="api1.0"/> |
jtulach@17 | 11 |
</antcall> |
jtulach@17 | 12 |
<antcall target="-build-one"> |
jtulach@17 | 13 |
<param name="version" value="api2.0"/> |
jtulach@17 | 14 |
</antcall> |
jtulach@181 | 15 |
<antcall target="-build-one"> |
jtulach@181 | 16 |
<param name="version" value="api2.0-compat"/> |
jtulach@181 | 17 |
</antcall> |
jtulach@181 | 18 |
<antcall target="-build-one"> |
jtulach@181 | 19 |
<param name="version" value="api2.0-property"/> |
jtulach@181 | 20 |
</antcall> |
jtulach@181 | 21 |
<antcall target="-build-one"> |
jtulach@181 | 22 |
<param name="version" value="api2.0-enum"/> |
jtulach@181 | 23 |
</antcall> |
jtulach@181 | 24 |
<antcall target="-build-one"> |
jtulach@181 | 25 |
<param name="version" value="api2.0-runtime"/> |
jtulach@181 | 26 |
</antcall> |
jtulach@17 | 27 |
|
jtulach@17 | 28 |
<antcall target="-build-one"> |
jtulach@17 | 29 |
<param name="version" value="test"/> |
jtulach@21 | 30 |
<param name="cp" value="build/api1.0/classes:${junit.jar}"/> |
jtulach@17 | 31 |
</antcall> |
jtulach@17 | 32 |
</target> |
jtulach@17 | 33 |
|
jtulach@17 | 34 |
<target name="test" depends="build"> |
jtulach@17 | 35 |
<echo level="info" message="Running the Implementation against Version 1.0 of the API. This should succeeds."/> |
jtulach@17 | 36 |
<antcall target="-run-one"> |
jtulach@17 | 37 |
<param name="version" value="api1.0"/> |
jtulach@17 | 38 |
</antcall> |
jtulach@17 | 39 |
<echo level="info" message="Running the Implementation against Version 2.0 of the API. This should fail."/> |
jtulach@17 | 40 |
<antcall target="-run-one"> |
jtulach@17 | 41 |
<param name="version" value="api2.0"/> |
jtulach@17 | 42 |
</antcall> |
jtulach@181 | 43 |
<echo level="info" message="Running the Implementation against Version 2.0 with compatible extension of the API. This should succeed."/> |
jtulach@181 | 44 |
<antcall target="-run-one"> |
jtulach@181 | 45 |
<param name="version" value="api2.0-compat"/> |
jtulach@181 | 46 |
</antcall> |
jtulach@181 | 47 |
<echo level="info" message="Running the Implementation against Version 2.0 with property guarded extension of the API. This should succeed."/> |
jtulach@181 | 48 |
<antcall target="-run-one"> |
jtulach@181 | 49 |
<param name="version" value="api2.0-property"/> |
jtulach@181 | 50 |
</antcall> |
jtulach@181 | 51 |
<echo level="info" message="Running the Implementation against Version 2.0 with enum guarded extension of the API. This should succeed."/> |
jtulach@181 | 52 |
<antcall target="-run-one"> |
jtulach@181 | 53 |
<param name="version" value="api2.0-enum"/> |
jtulach@181 | 54 |
</antcall> |
jtulach@181 | 55 |
<echo level="info" message="Running the Implementation against Version 2.0 with runtime check in the API. This should succeed."/> |
jtulach@181 | 56 |
<antcall target="-run-one"> |
jtulach@181 | 57 |
<param name="version" value="api2.0-runtime"/> |
jtulach@181 | 58 |
</antcall> |
jtulach@17 | 59 |
</target> |
jtulach@17 | 60 |
|
jtulach@17 | 61 |
<!-- support methods --> |
jtulach@17 | 62 |
|
jtulach@21 | 63 |
<target name="-libraries"> |
jtulach@21 | 64 |
<ant dir="../libs/"/> |
jtulach@21 | 65 |
|
jtulach@21 | 66 |
<property name="junit.jar" location="../libs/dist/junit-4.4.jar"/> |
jtulach@21 | 67 |
</target> |
jtulach@21 | 68 |
|
jtulach@17 | 69 |
<target name="-run-one"> |
jtulach@17 | 70 |
<fail message="You need to specify API version number" unless="version"/> |
jtulach@19 | 71 |
<mkdir dir="build/testresults"/> |
jtulach@19 | 72 |
<junit dir="build/test/classes" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true"> |
jtulach@19 | 73 |
<batchtest todir="build/testresults"> |
jtulach@19 | 74 |
<fileset dir="build/test/classes"> |
jtulach@19 | 75 |
<filename name="**/*Test.class"/> |
jtulach@19 | 76 |
</fileset> |
jtulach@19 | 77 |
</batchtest> |
jtulach@19 | 78 |
<classpath> |
jtulach@19 | 79 |
<path location="build/${version}/classes"/> |
jtulach@19 | 80 |
<path location="build/test/classes"/> |
jtulach@21 | 81 |
<path location="${junit.jar}"/> |
jtulach@19 | 82 |
</classpath> |
jtulach@263 | 83 |
<syspropertyset> |
jtulach@263 | 84 |
<propertyref prefix="test-sys-prop."/> |
jtulach@263 | 85 |
<mapper from="test-sys-prop.*" to="*" type="glob"/> |
jtulach@263 | 86 |
</syspropertyset> |
jtulach@19 | 87 |
<formatter type="brief" usefile="false"/> |
jtulach@19 | 88 |
<formatter type="xml"/> |
jtulach@19 | 89 |
</junit> |
jtulach@17 | 90 |
</target> |
jtulach@17 | 91 |
|
jtulach@17 | 92 |
<target name="-build-one"> |
jtulach@17 | 93 |
<fail message="You need to specify version number" unless="version"/> |
jtulach@17 | 94 |
|
jtulach@17 | 95 |
<mkdir dir="build/${version}/classes"/> |
jtulach@17 | 96 |
<property name="cp" value=""/> |
jtulach@17 | 97 |
<javac |
jtulach@17 | 98 |
srcdir="src-${version}" |
jtulach@17 | 99 |
destdir="build/${version}/classes" |
jtulach@17 | 100 |
source="1.5" target="1.5" |
jtulach@17 | 101 |
classpath="${cp}" |
jtulach@187 | 102 |
debug="true" |
jtulach@17 | 103 |
/> |
jtulach@17 | 104 |
</target> |
jtulach@15 | 105 |
</project> |