Skip to content

Commit d2a2e75

Browse files
committed
build library module
1 parent 5879cc1 commit d2a2e75

1 file changed

Lines changed: 10 additions & 27 deletions

File tree

‎build.xml‎

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
</jar>
5050
</target>
5151

52+
<target name="library" depends="core" description="Build library of matchers">
53+
<path id="cp-hamcrest-library-main" path="build/hamcrest-core-${version}.jar"/>
54+
<path id="cp-hamcrest-library-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-test.jar"/>
55+
<compile-module modulename="hamcrest-library"/>
56+
<test-module modulename="hamcrest-library"/>
57+
<generate-module-factory modulename="hamcrest-library" configurationfile="matchers.xml" targetclass="org.hamcrest.Matchers"/>
58+
</target>
59+
5260
<macrodef name="compile-module">
5361
<attribute name="modulename" description="Name of the module to jar"/>
5462

@@ -107,32 +115,6 @@
107115
</sequential>
108116
</macrodef>
109117

110-
<target name="library"
111-
depends="core,generator"
112-
description="Build library of matchers">
113-
<mkdir dir="build/temp/hamcrest-library/generated-code"/>
114-
<java-to-jar srcdir="hamcrest-library/src/main/java"
115-
modulename="hamcrest-library"
116-
classpath="build/hamcrest-core-${version}.jar"/>
117-
<!-- Generate one class with all static imports -->
118-
<java classname="org.hamcrest.generator.config.XmlConfigurator"
119-
fork="yes"
120-
failonerror="yes"
121-
classpath="
122-
build/hamcrest-core-${version}.jar;
123-
build/hamcrest-generator-${version}.jar;
124-
build/hamcrest-library-${version}.jar;
125-
">
126-
<arg value="matchers.xml"/>
127-
<arg value="hamcrest-core/src/main/java,hamcrest-library/src/main/java"/>
128-
<arg value="org.hamcrest.Matchers"/>
129-
<arg value="build/temp/hamcrest-library/generated-code"/>
130-
</java>
131-
<!-- Append to library jar -->
132-
<java-to-jar srcdir="build/temp/hamcrest-library/generated-code"
133-
modulename="hamcrest-library"
134-
classpath="build/hamcrest-core-${version}.jar"/>
135-
</target>
136118

137119
<target name="integration" depends="core, library" description="Build integration with external tools">
138120
<java-to-jar srcdir="hamcrest-integration/src/main/java"
@@ -396,7 +378,8 @@
396378
<macrodef name="test-module" description="run unit tests.">
397379
<attribute name="modulename" description="Name of the module to jar"/>
398380
<sequential>
399-
<junit printsummary="no" fork="no" haltonfailure="${haltonfailure}">
381+
<mkdir dir="build/temp/@{modulename}/test-wrk"/>
382+
<junit printsummary="no" forkmode="once" tempdir="build/temp/@{modulename}/test-wrk" haltonfailure="${haltonfailure}">
400383
<formatter type="brief" usefile="no"/>
401384
<classpath refid="cp-@{modulename}-main"/>
402385
<classpath refid="cp-@{modulename}-test"/>

0 commit comments

Comments
 (0)