|
12 | 12 |
|
13 | 13 | <target name="generator" description="Build code generator tool"> |
14 | 14 | <java-to-jar srcdir="hamcrest-generator/src/main/java" |
15 | | - destjar="hamcrest-generator-${version}-nodeps" |
| 15 | + modulename="hamcrest-generator-${version}-nodeps" |
16 | 16 | classpath="lib/generator/qdox-1.12.jar"/> |
17 | 17 |
|
18 | 18 | <!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package --> |
|
25 | 25 | </target> |
26 | 26 |
|
27 | 27 | <target name="core" depends="generator" description="Build core Hamcrest library"> |
28 | | - <java-to-jar srcdir="hamcrest-core/src/main/java" destjar="hamcrest-core-${version}"/> |
| 28 | + <java-to-jar srcdir="hamcrest-core/src/main/java" modulename="hamcrest-core-${version}"/> |
29 | 29 |
|
30 | 30 | <!-- Generate one class with all static imports --> |
31 | 31 | <mkdir dir="build/temp/hamcrest-core/generated-code"/> |
|
44 | 44 | </java> |
45 | 45 | <!-- Append to core jar --> |
46 | 46 | <java-to-jar srcdir="build/temp/hamcrest-core/generated-code" |
47 | | - destjar="hamcrest-core-${version}" |
| 47 | + modulename="hamcrest-core-${version}" |
48 | 48 | classpath="build/hamcrest-core-${version}.jar"/> |
49 | 49 | </target> |
50 | 50 |
|
|
53 | 53 | description="Build library of matchers"> |
54 | 54 | <mkdir dir="build/temp/hamcrest-library/generated-code"/> |
55 | 55 | <java-to-jar srcdir="hamcrest-library/src/main/java" |
56 | | - destjar="hamcrest-library-${version}" |
| 56 | + modulename="hamcrest-library-${version}" |
57 | 57 | classpath="build/hamcrest-core-${version}.jar"/> |
58 | 58 | <!-- Generate one class with all static imports --> |
59 | 59 | <java classname="org.hamcrest.generator.config.XmlConfigurator" |
|
71 | 71 | </java> |
72 | 72 | <!-- Append to library jar --> |
73 | 73 | <java-to-jar srcdir="build/temp/hamcrest-library/generated-code" |
74 | | - destjar="hamcrest-library-${version}" |
| 74 | + modulename="hamcrest-library-${version}" |
75 | 75 | classpath="build/hamcrest-core-${version}.jar"/> |
76 | 76 | </target> |
77 | 77 |
|
78 | 78 | <target name="integration" depends="core, library" description="Build integration with external tools"> |
79 | | - <java-to-jar srcdir="hamcrest-integration/src/main/java" destjar="hamcrest-integration-${version}" |
| 79 | + <java-to-jar srcdir="hamcrest-integration/src/main/java" modulename="hamcrest-integration-${version}" |
80 | 80 | classpath=" |
81 | 81 | build/hamcrest-core-${version}.jar; |
82 | 82 | build/hamcrest-library-${version}.jar"/> |
83 | 83 | </target> |
84 | 84 |
|
85 | 85 | <target name="unit-test" depends="core, library, integration, generator" description="Build and run unit tests."> |
86 | | - <java-to-jar srcdir="hamcrest-unit-test/src/main/java" destjar="hamcrest-unit-test-${version}" |
| 86 | + <java-to-jar srcdir="hamcrest-unit-test/src/main/java" modulename="hamcrest-unit-test-${version}" |
87 | 87 | classpath=" |
88 | 88 | build/hamcrest-core-${version}.jar; |
89 | 89 | build/hamcrest-library-${version}.jar; |
|
112 | 112 |
|
113 | 113 | <target name="examples" depends="core, library, integration" description="Build and run unit tests."> |
114 | 114 | <java-to-jar srcdir="hamcrest-examples/src/main/java" |
115 | | - destjar="hamcrest-examples-${version}" |
| 115 | + modulename="hamcrest-examples-${version}" |
116 | 116 | classpath=" |
117 | 117 | build/hamcrest-core-${version}.jar; |
118 | 118 | build/hamcrest-library-${version}.jar; |
|
188 | 188 | </javadoc> |
189 | 189 | </target> |
190 | 190 |
|
191 | | - <macrodef name="java-to-jar" description="Compile Java source and build a Jar"> |
| 191 | + <macrodef name="java-to-jar" description="Compile Java source for a module and build a Jar"> |
192 | 192 | <attribute name="srcdir" description="Directory containg Java source"/> |
193 | | - <attribute name="destjar" description="Path to Jar"/> |
| 193 | + <attribute name="modulename" description="Name of the module to jar"/> |
194 | 194 | <attribute name="classpath" description="Anything additional to add on the classpath" default=""/> |
195 | 195 | <sequential> |
196 | | - <mkdir dir="build/temp/@{destjar}.jar.contents"/> |
197 | | - <javac srcdir="@{srcdir}" destdir="build/temp/@{destjar}.jar.contents" debug="${debug}" target="1.5"> |
| 196 | + <mkdir dir="build/temp/@{modulename}.jar.contents"/> |
| 197 | + <javac srcdir="@{srcdir}" destdir="build/temp/@{modulename}.jar.contents" debug="${debug}" target="1.5"> |
198 | 198 | <classpath> |
199 | 199 | <fileset dir="lib/integration"> |
200 | 200 | <include name="*.jar"/> |
201 | 201 | </fileset> |
202 | 202 | <pathelement path="@{classpath}"/> |
203 | 203 | </classpath> |
204 | 204 | </javac> |
205 | | - <copy file="LICENSE.txt" todir="build/temp/@{destjar}.jar.contents"/> |
| 205 | + <copy file="LICENSE.txt" todir="build/temp/@{modulename}.jar.contents"/> |
206 | 206 | <!-- Put Java source in Jars for user's convenience. --> |
207 | | - <copy todir="build/temp/@{destjar}.jar.contents"> |
| 207 | + <copy todir="build/temp/@{modulename}.jar.contents"> |
208 | 208 | <fileset dir="@{srcdir}"/> |
209 | 209 | </copy> |
210 | | - <jar jarfile="build/@{destjar}.jar"> |
211 | | - <fileset dir="build/temp/@{destjar}.jar.contents"/> |
| 210 | + <jar jarfile="build/@{modulename}.jar"> |
| 211 | + <fileset dir="build/temp/@{modulename}.jar.contents"/> |
212 | 212 | </jar> |
213 | 213 | </sequential> |
214 | 214 | </macrodef> |
|
0 commit comments