|
15 | 15 | <path id="cp-hamcrest-api-main" path=""/> |
16 | 16 | <path id="cp-hamcrest-api-test" path="lib/integration/junit-dep-4.10.jar"/> |
17 | 17 | <compile-module modulename="hamcrest-api"/> |
| 18 | + <jar-module modulename="hamcrest-api"/> |
18 | 19 | <test-module modulename="hamcrest-api"/> |
19 | 20 | </target> |
20 | 21 |
|
21 | 22 | <target name="generator" depends="api" description="Build code generator tool"> |
22 | 23 | <path id="cp-hamcrest-generator-main" path="lib/generator/qdox-1.12.jar;build/hamcrest-api-${version}.jar"/> |
23 | 24 | <path id="cp-hamcrest-generator-test" path="lib/integration/junit-dep-4.10.jar"/> |
24 | 25 | <compile-module modulename="hamcrest-generator"/> |
| 26 | + <jar-module modulename="hamcrest-generator"/> |
25 | 27 | <test-module modulename="hamcrest-generator"/> |
26 | 28 |
|
27 | 29 | <!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package --> |
|
38 | 40 | <path id="cp-hamcrest-core-main" path="build/hamcrest-api-${version}.jar"/> |
39 | 41 | <path id="cp-hamcrest-core-test" path="lib/integration/junit-dep-4.10.jar"/> |
40 | 42 | <compile-module modulename="hamcrest-core"/> |
41 | | - <test-module modulename="hamcrest-core"/> |
42 | 43 | <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"/> |
43 | 46 |
|
44 | 47 | <!-- Bundle api into core jar --> |
45 | 48 | <copy file="build/hamcrest-core-${version}.jar" tofile="build/hamcrest-core-${version}-nodep.jar"/> |
|
53 | 56 | <path id="cp-hamcrest-library-main" path="build/hamcrest-core-${version}.jar"/> |
54 | 57 | <path id="cp-hamcrest-library-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/> |
55 | 58 | <compile-module modulename="hamcrest-library"/> |
56 | | - <test-module modulename="hamcrest-library"/> |
57 | 59 | <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"/> |
58 | 62 | </target> |
59 | 63 |
|
60 | 64 | <target name="integration" depends="library" description="Build integration with external tools"> |
|
65 | 69 | </path> |
66 | 70 | <path id="cp-hamcrest-integration-test" path="lib/integration/junit-dep-4.10.jar;build/hamcrest-core-${version}-tests.jar"/> |
67 | 71 | <compile-module modulename="hamcrest-integration"/> |
| 72 | + <jar-module modulename="hamcrest-integration"/> |
68 | 73 | <test-module modulename="hamcrest-integration"/> |
69 | 74 | </target> |
70 | 75 |
|
|
76 | 81 | <fileset dir="lib/integration" includes="**/*.jar"/> |
77 | 82 | </path> |
78 | 83 | <compile-module modulename="hamcrest-examples"/> |
| 84 | + <jar-module modulename="hamcrest-examples"/> |
79 | 85 | </target> |
80 | 86 |
|
81 | 87 | <macrodef name="compile-module"> |
|
104 | 110 | <classpath refid="cp-@{modulename}-test"/> |
105 | 111 | <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
106 | 112 | </javac> |
107 | | - |
108 | | - <jar-module modulename="@{modulename}"/> |
109 | 113 | </sequential> |
110 | 114 | </macrodef> |
111 | 115 |
|
|
139 | 143 | <java classname="org.hamcrest.generator.config.XmlConfigurator" fork="yes" failonerror="yes"> |
140 | 144 | <classpath path="build/hamcrest-generator-${version}.jar"/> |
141 | 145 | <classpath refid="cp-@{modulename}-main"/> |
142 | | - <classpath path="build/@{modulename}-${version}.jar"/> |
| 146 | + <classpath path="build/temp/@{modulename}-${version}.jar.contents"/> |
143 | 147 | <arg value="@{configurationfile}"/> |
144 | 148 | <arg value="@{modulename}/src/main/java"/> |
145 | 149 | <arg value="@{targetclass}"/> |
146 | 150 | <arg value="build/temp/@{modulename}/generated-code"/> |
147 | 151 | </java> |
148 | 152 |
|
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}"/> |
158 | 157 | </sequential> |
159 | 158 | </macrodef> |
160 | 159 |
|
|
0 commit comments