Skip to content

Commit 6354af9

Browse files
committed
jar after generating factory classes
1 parent 9e749d7 commit 6354af9

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

‎build.xml‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
<path id="cp-hamcrest-api-main" path=""/>
1616
<path id="cp-hamcrest-api-test" path="lib/integration/junit-dep-4.10.jar"/>
1717
<compile-module modulename="hamcrest-api"/>
18+
<jar-module modulename="hamcrest-api"/>
1819
<test-module modulename="hamcrest-api"/>
1920
</target>
2021

2122
<target name="generator" depends="api" description="Build code generator tool">
2223
<path id="cp-hamcrest-generator-main" path="lib/generator/qdox-1.12.jar;build/hamcrest-api-${version}.jar"/>
2324
<path id="cp-hamcrest-generator-test" path="lib/integration/junit-dep-4.10.jar"/>
2425
<compile-module modulename="hamcrest-generator"/>
26+
<jar-module modulename="hamcrest-generator"/>
2527
<test-module modulename="hamcrest-generator"/>
2628

2729
<!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package -->
@@ -38,8 +40,9 @@
3840
<path id="cp-hamcrest-core-main" path="build/hamcrest-api-${version}.jar"/>
3941
<path id="cp-hamcrest-core-test" path="lib/integration/junit-dep-4.10.jar"/>
4042
<compile-module modulename="hamcrest-core"/>
41-
<test-module modulename="hamcrest-core"/>
4243
<generate-module-factory modulename="hamcrest-core" configurationfile="core-matchers.xml" targetclass="org.hamcrest.CoreMatchers"/>
44+
<jar-module modulename="hamcrest-core"/>
45+
<test-module modulename="hamcrest-core"/>
4346

4447
<!-- Bundle api into core jar -->
4548
<copy file="build/hamcrest-core-${version}.jar" tofile="build/hamcrest-core-${version}-nodep.jar"/>
@@ -53,8 +56,9 @@
5356
<path id="cp-hamcrest-library-main" path="build/hamcrest-core-${version}.jar"/>
5457
<path id="cp-hamcrest-library-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/>
5558
<compile-module modulename="hamcrest-library"/>
56-
<test-module modulename="hamcrest-library"/>
5759
<generate-module-factory modulename="hamcrest-library" configurationfile="matchers.xml" targetclass="org.hamcrest.Matchers"/>
60+
<jar-module modulename="hamcrest-library"/>
61+
<test-module modulename="hamcrest-library"/>
5862
</target>
5963

6064
<target name="integration" depends="library" description="Build integration with external tools">
@@ -65,6 +69,7 @@
6569
</path>
6670
<path id="cp-hamcrest-integration-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/>
6771
<compile-module modulename="hamcrest-integration"/>
72+
<jar-module modulename="hamcrest-integration"/>
6873
<test-module modulename="hamcrest-integration"/>
6974
</target>
7075

@@ -76,6 +81,7 @@
7681
<fileset dir="lib/integration" includes="**/*.jar"/>
7782
</path>
7883
<compile-module modulename="hamcrest-examples"/>
84+
<jar-module modulename="hamcrest-examples"/>
7985
</target>
8086

8187
<macrodef name="compile-module">
@@ -104,8 +110,6 @@
104110
<classpath refid="cp-@{modulename}-test"/>
105111
<classpath path="build/temp/@{modulename}-${version}.jar.contents"/>
106112
</javac>
107-
108-
<jar-module modulename="@{modulename}"/>
109113
</sequential>
110114
</macrodef>
111115

@@ -139,22 +143,17 @@
139143
<java classname="org.hamcrest.generator.config.XmlConfigurator" fork="yes" failonerror="yes">
140144
<classpath path="build/hamcrest-generator-${version}.jar"/>
141145
<classpath refid="cp-@{modulename}-main"/>
142-
<classpath path="build/@{modulename}-${version}.jar"/>
146+
<classpath path="build/temp/@{modulename}-${version}.jar.contents"/>
143147
<arg value="@{configurationfile}"/>
144148
<arg value="@{modulename}/src/main/java"/>
145149
<arg value="@{targetclass}"/>
146150
<arg value="build/temp/@{modulename}/generated-code"/>
147151
</java>
148152

149-
<!-- Append generated code to core jar -->
150-
<javac srcdir="build/temp/@{modulename}/generated-code"
151-
destdir="build/temp/@{modulename}-${version}.jar.contents"
152-
debug="${debug}" source="1.5" target="1.5" includeantruntime="false">
153-
<classpath refid="cp-@{modulename}-main"/>
154-
</javac>
155-
<jar jarfile="build/@{modulename}-${version}.jar" manifest="build/temp/@{modulename}-${version}.jar.manifest/MANIFEST.MF">
156-
<fileset dir="build/temp/@{modulename}-${version}.jar.contents"/>
157-
</jar>
153+
<copy todir="build/temp/@{modulename}-${version}-sources.jar.contents">
154+
<fileset dir="build/temp/@{modulename}/generated-code"/>
155+
</copy>
156+
<compile-module modulename="@{modulename}"/>
158157
</sequential>
159158
</macrodef>
160159

0 commit comments

Comments
 (0)