Skip to content

Commit 9446bf6

Browse files
committed
extract java version and junit jar references
1 parent 58ea973 commit 9446bf6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎build.xml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<property name="version" value="SNAPSHOT" description="Version number to use in build files"/>
44
<property name="haltonfailure" value="true" description="Whether to halt the build if the tests fail"/>
55
<property name="debug" value="true" description="Whether to build with debug information"/>
6+
<property name="javaversion" value="1.5" description="Java version to target"/>
67
<tstamp><format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss" timezone="GMT"/></tstamp>
78

89
<target name="all" depends="clean, bigjar" description="Performs clean build, runs tests and packages for distribution"/>
@@ -13,15 +14,15 @@
1314

1415
<target name="api" description="Build Hamcrest APIs">
1516
<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=""/>
1718
<compile-module modulename="hamcrest-api"/>
1819
<jar-module modulename="hamcrest-api"/>
1920
<test-module modulename="hamcrest-api"/>
2021
</target>
2122

2223
<target name="generator" depends="api" description="Build code generator tool">
2324
<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=""/>
2526
<compile-module modulename="hamcrest-generator"/>
2627
<jar-module modulename="hamcrest-generator"/>
2728
<test-module modulename="hamcrest-generator"/>
@@ -38,7 +39,7 @@
3839

3940
<target name="core" depends="generator" description="Build core Hamcrest library">
4041
<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=""/>
4243
<compile-module modulename="hamcrest-core"/>
4344
<generate-module-factory modulename="hamcrest-core" configurationfile="core-matchers.xml" targetclass="org.hamcrest.CoreMatchers"/>
4445
<jar-module modulename="hamcrest-core"/>
@@ -47,7 +48,7 @@
4748

4849
<target name="library" depends="core" description="Build library of matchers">
4950
<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"/>
5152
<compile-module modulename="hamcrest-library"/>
5253
<generate-module-factory modulename="hamcrest-library" configurationfile="matchers.xml" targetclass="org.hamcrest.Matchers"/>
5354
<jar-module modulename="hamcrest-library"/>
@@ -61,7 +62,7 @@
6162
<fileset file="build/hamcrest-library-${version}.jar"/>
6263
<fileset dir="lib/integration" includes="**/*.jar"/>
6364
</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"/>
6566
<compile-module modulename="hamcrest-integration"/>
6667
<jar-module modulename="hamcrest-integration"/>
6768
<test-module modulename="hamcrest-integration"/>
@@ -155,6 +156,7 @@
155156
<sequential>
156157
<compile-content srcdir="@{modulename}/src/main/java" jarname="@{modulename}-${version}" classpathref="cp-@{modulename}-main" />
157158
<path id="cp-@{modulename}-test-complete">
159+
<path path="lib/integration/junit-dep-4.10.jar"/>
158160
<path refid="cp-@{modulename}-main"/>
159161
<path refid="cp-@{modulename}-test"/>
160162
<path path="build/temp/@{modulename}-${version}.jar.contents"/>
@@ -175,7 +177,7 @@
175177
<mkdir dir="build/temp/@{jarname}.jar.contents"/>
176178
<javac srcdir="build/temp/@{jarname}-sources.jar.contents"
177179
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">
179181
<classpath refid="@{classpathref}"/>
180182
</javac>
181183
</sequential>
@@ -231,9 +233,7 @@
231233
<mkdir dir="build/temp/@{modulename}/test-wrk"/>
232234
<junit printsummary="no" forkmode="once" tempdir="build/temp/@{modulename}/test-wrk" haltonfailure="${haltonfailure}">
233235
<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"/>
237237
<classpath path="build/@{modulename}-${version}-tests.jar"/>
238238
<batchtest fork="yes" todir="${build.dir}/testreport">
239239
<zipfileset src="build/@{modulename}-${version}-tests.jar">
@@ -250,7 +250,7 @@
250250
<sequential>
251251
<javadoc packagenames="org.hamcrest.*" sourcepath="build/temp/@{modulename}-${version}-sources.jar.contents"
252252
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">
254254
<classpath refid="cp-@{modulename}-main"/>
255255
</javadoc>
256256
<jar-module-component modulename="@{modulename}" suffix="-javadoc"/>

0 commit comments

Comments
 (0)