|
3 | 3 | <property name="version" value="SNAPSHOT" description="Version number to use in build files"/> |
4 | 4 | <property name="haltonfailure" value="true" description="Whether to halt the build if the tests fail"/> |
5 | 5 | <property name="debug" value="true" description="Whether to build with debug information"/> |
| 6 | + <property name="javaversion" value="1.5" description="Java version to target"/> |
6 | 7 | <tstamp><format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss" timezone="GMT"/></tstamp> |
7 | 8 |
|
8 | 9 | <target name="all" depends="clean, bigjar" description="Performs clean build, runs tests and packages for distribution"/> |
|
13 | 14 |
|
14 | 15 | <target name="api" description="Build Hamcrest APIs"> |
15 | 16 | <path id="cp-hamcrest-api-main" path=""/> |
16 | | - <path id="cp-hamcrest-api-test" path="lib/integration/junit-dep-4.10.jar"/> |
| 17 | + <path id="cp-hamcrest-api-test" path=""/> |
17 | 18 | <compile-module modulename="hamcrest-api"/> |
18 | 19 | <jar-module modulename="hamcrest-api"/> |
19 | 20 | <test-module modulename="hamcrest-api"/> |
20 | 21 | </target> |
21 | 22 |
|
22 | 23 | <target name="generator" depends="api" description="Build code generator tool"> |
23 | 24 | <path id="cp-hamcrest-generator-main" path="lib/generator/qdox-1.12.jar;build/hamcrest-api-${version}.jar"/> |
24 | | - <path id="cp-hamcrest-generator-test" path="lib/integration/junit-dep-4.10.jar"/> |
| 25 | + <path id="cp-hamcrest-generator-test" path=""/> |
25 | 26 | <compile-module modulename="hamcrest-generator"/> |
26 | 27 | <jar-module modulename="hamcrest-generator"/> |
27 | 28 | <test-module modulename="hamcrest-generator"/> |
|
38 | 39 |
|
39 | 40 | <target name="core" depends="generator" description="Build core Hamcrest library"> |
40 | 41 | <path id="cp-hamcrest-core-main" path="build/hamcrest-api-${version}.jar"/> |
41 | | - <path id="cp-hamcrest-core-test" path="lib/integration/junit-dep-4.10.jar"/> |
| 42 | + <path id="cp-hamcrest-core-test" path=""/> |
42 | 43 | <compile-module modulename="hamcrest-core"/> |
43 | 44 | <generate-module-factory modulename="hamcrest-core" configurationfile="core-matchers.xml" targetclass="org.hamcrest.CoreMatchers"/> |
44 | 45 | <jar-module modulename="hamcrest-core"/> |
|
47 | 48 |
|
48 | 49 | <target name="library" depends="core" description="Build library of matchers"> |
49 | 50 | <path id="cp-hamcrest-library-main" path="build/hamcrest-api-${version}.jar;build/hamcrest-core-${version}.jar"/> |
50 | | - <path id="cp-hamcrest-library-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/> |
| 51 | + <path id="cp-hamcrest-library-test" path="build/hamcrest-core-${version}-tests.jar"/> |
51 | 52 | <compile-module modulename="hamcrest-library"/> |
52 | 53 | <generate-module-factory modulename="hamcrest-library" configurationfile="matchers.xml" targetclass="org.hamcrest.Matchers"/> |
53 | 54 | <jar-module modulename="hamcrest-library"/> |
|
61 | 62 | <fileset file="build/hamcrest-library-${version}.jar"/> |
62 | 63 | <fileset dir="lib/integration" includes="**/*.jar"/> |
63 | 64 | </path> |
64 | | - <path id="cp-hamcrest-integration-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/> |
| 65 | + <path id="cp-hamcrest-integration-test" path="build/hamcrest-core-${version}-tests.jar"/> |
65 | 66 | <compile-module modulename="hamcrest-integration"/> |
66 | 67 | <jar-module modulename="hamcrest-integration"/> |
67 | 68 | <test-module modulename="hamcrest-integration"/> |
|
155 | 156 | <sequential> |
156 | 157 | <compile-content srcdir="@{modulename}/src/main/java" jarname="@{modulename}-${version}" classpathref="cp-@{modulename}-main" /> |
157 | 158 | <path id="cp-@{modulename}-test-complete"> |
| 159 | + <path path="lib/integration/junit-dep-4.10.jar"/> |
158 | 160 | <path refid="cp-@{modulename}-main"/> |
159 | 161 | <path refid="cp-@{modulename}-test"/> |
160 | 162 | <path path="build/temp/@{modulename}-${version}.jar.contents"/> |
|
175 | 177 | <mkdir dir="build/temp/@{jarname}.jar.contents"/> |
176 | 178 | <javac srcdir="build/temp/@{jarname}-sources.jar.contents" |
177 | 179 | destdir="build/temp/@{jarname}.jar.contents" |
178 | | - debug="${debug}" source="1.5" target="1.5" includeantruntime="false"> |
| 180 | + debug="${debug}" source="${javaversion}" target="${javaversion}" includeantruntime="false"> |
179 | 181 | <classpath refid="@{classpathref}"/> |
180 | 182 | </javac> |
181 | 183 | </sequential> |
|
231 | 233 | <mkdir dir="build/temp/@{modulename}/test-wrk"/> |
232 | 234 | <junit printsummary="no" forkmode="once" tempdir="build/temp/@{modulename}/test-wrk" haltonfailure="${haltonfailure}"> |
233 | 235 | <formatter type="brief" usefile="no"/> |
234 | | - <classpath refid="cp-@{modulename}-main"/> |
235 | | - <classpath refid="cp-@{modulename}-test"/> |
236 | | - <classpath path="build/@{modulename}-${version}.jar"/> |
| 236 | + <classpath refid="cp-@{modulename}-test-complete"/> |
237 | 237 | <classpath path="build/@{modulename}-${version}-tests.jar"/> |
238 | 238 | <batchtest fork="yes" todir="${build.dir}/testreport"> |
239 | 239 | <zipfileset src="build/@{modulename}-${version}-tests.jar"> |
|
250 | 250 | <sequential> |
251 | 251 | <javadoc packagenames="org.hamcrest.*" sourcepath="build/temp/@{modulename}-${version}-sources.jar.contents" |
252 | 252 | destdir="build/temp/@{modulename}-${version}-javadoc.jar.contents" author="true" version="true" |
253 | | - use="true" windowtitle="Hamcrest" source="1.5" failonerror="yes" defaultexcludes="yes"> |
| 253 | + use="true" windowtitle="Hamcrest" source="${javaversion}" failonerror="yes" defaultexcludes="yes"> |
254 | 254 | <classpath refid="cp-@{modulename}-main"/> |
255 | 255 | </javadoc> |
256 | 256 | <jar-module-component modulename="@{modulename}" suffix="-javadoc"/> |
|
0 commit comments