Skip to content

Commit 80b7004

Browse files
committed
try to get things building again
1 parent ec89248 commit 80b7004

1 file changed

Lines changed: 45 additions & 28 deletions

File tree

‎build.xml‎

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,33 +84,6 @@
8484
build/hamcrest-library-${version}.jar"/>
8585
</target>
8686

87-
<target name="unit-test" depends="core, library, integration, generator" description="Build and run unit tests.">
88-
<java-to-jar srcdir="hamcrest-unit-test/src/main/java" modulename="hamcrest-unit-test"
89-
classpath="build/hamcrest-core-${version}.jar;
90-
build/hamcrest-library-${version}.jar;
91-
build/hamcrest-integration-${version}.jar;
92-
build/hamcrest-generator-${version}.jar"/>
93-
<junit printsummary="no" fork="no" haltonfailure="${haltonfailure}">
94-
<formatter type="brief" usefile="no"/>
95-
<classpath>
96-
<fileset dir="lib/integration">
97-
<include name="*.jar"/>
98-
</fileset>
99-
<pathelement path="build/hamcrest-core-${version}.jar"/>
100-
<pathelement path="build/hamcrest-library-${version}.jar"/>
101-
<pathelement path="build/hamcrest-integration-${version}.jar"/>
102-
<pathelement path="build/hamcrest-generator-${version}.jar"/>
103-
<pathelement path="build/hamcrest-unit-test-${version}.jar"/>
104-
</classpath>
105-
<batchtest>
106-
<fileset dir="hamcrest-unit-test/src/main/java">
107-
<include name="**/*Test*"/>
108-
<exclude name="**/Abstract*"/>
109-
</fileset>
110-
</batchtest>
111-
</junit>
112-
</target>
113-
11487
<target name="examples" depends="core, library, integration" description="Build and run unit tests.">
11588
<java-to-jar srcdir="hamcrest-examples/src/main/java"
11689
modulename="hamcrest-examples"
@@ -174,7 +147,7 @@
174147
</jar>
175148
</target>
176149

177-
<target name="package" depends="core, generator, library, integration, bigjar, unit-test, examples, javadoc" description="Package for distribution">
150+
<target name="package" depends="core, generator, library, integration, bigjar, examples, javadoc" description="Package for distribution">
178151
<copy todir="build">
179152
<fileset dir="pom" includes="*.pom"/>
180153
<filterset><filter token="VERSION" value="${version}"/></filterset>
@@ -283,6 +256,8 @@
283256
<attribute name="Built-By" value="${user.name}"/>
284257
<attribute name="Built-Date" value="${build.timestamp}"/>
285258
</manifest>
259+
260+
<!-- Build jar -->
286261
<mkdir dir="build/temp/@{modulename}-${version}.jar.contents"/>
287262
<javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.jar.contents" debug="${debug}" source="1.5" target="1.5" includeantruntime="false">
288263
<classpath>
@@ -297,6 +272,21 @@
297272
<fileset dir="build/temp/@{modulename}-${version}.jar.contents"/>
298273
</jar>
299274

275+
<!-- Build test jar -->
276+
<mkdir dir="build/temp/@{modulename}-${version}.testjar.contents"/>
277+
<javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}-${version}.testjar.contents" debug="${debug}" source="1.5" target="1.5" includeantruntime="false">
278+
<classpath>
279+
<fileset dir="lib/integration">
280+
<include name="*.jar"/>
281+
</fileset>
282+
<pathelement path="build/@{modulename}-${version}.jar"/>
283+
<pathelement path="@{classpath}"/>
284+
</classpath>
285+
</javac>
286+
<jar jarfile="build/@{modulename}-${version}-tests.jar" manifest="build/temp/@{modulename}-${version}.jar.manifest/MANIFEST.MF">
287+
<fileset dir="build/temp/@{modulename}-${version}.testjar.contents"/>
288+
</jar>
289+
300290
<!-- Build sources jar -->
301291
<copy todir="build/temp/@{modulename}-${version}-sources.jar.contents">
302292
<fileset dir="@{srcdir}"/>
@@ -330,4 +320,31 @@
330320
</jar>
331321
</sequential>
332322
</macrodef>
323+
324+
<macrodef name="unit-test" description="run unit tests.">
325+
<attribute name="modulename" description="Name of the module to jar"/>
326+
<attribute name="classpath" description="Anything additional to add on the classpath" default=""/>
327+
<sequential>
328+
<junit printsummary="no" fork="no" haltonfailure="${haltonfailure}">
329+
<formatter type="brief" usefile="no"/>
330+
<classpath>
331+
<fileset dir="lib/integration">
332+
<include name="*.jar"/>
333+
</fileset>
334+
<pathelement path="build/hamcrest-core-${version}.jar"/>
335+
<pathelement path="build/hamcrest-library-${version}.jar"/>
336+
<pathelement path="build/hamcrest-integration-${version}.jar"/>
337+
<pathelement path="build/hamcrest-generator-${version}.jar"/>
338+
<pathelement path="build/hamcrest-unit-test-${version}.jar"/>
339+
</classpath>
340+
<batchtest>
341+
<batchtest fork="yes" todir="${build.dir}/testreport">
342+
<zipfileset src="build/@{modulename}-${version}-tests.jar">
343+
<include name="org/hamcrest/**/*Test.class"/>
344+
</zipfileset>
345+
</batchtest>
346+
</batchtest>
347+
</junit>
348+
</sequential>
349+
</macrodef>
333350
</project>

0 commit comments

Comments
 (0)