|
1 | 1 | <project name="hamcrest" default="all">
|
2 | 2 |
|
3 |
| - <property name="version" |
4 |
| - value="SNAPSHOT" |
5 |
| - description="Version number to use in build files"/> |
| 3 | + <property name="version" value="SNAPSHOT" description="Version number to use in build files"/> |
| 4 | + <property name="haltonfailure" value="true" description="Whether to halt the build if the tests fail"/> |
| 5 | + <property name="debug" value="true" description="Whether to build with debug information"/> |
6 | 6 |
|
7 |
| - <property name="haltonfailure" |
8 |
| - value="true" |
9 |
| - description="Whether to halt the build if the tests fail"/> |
| 7 | + <target name="all" depends="clean, package" description="Performs clean build, runs tests and packages for distribution"/> |
10 | 8 |
|
11 |
| - <property name="debug" |
12 |
| - value="true" |
13 |
| - description="Whether to build with debug information"/> |
14 |
| - |
15 |
| - <target name="all" |
16 |
| - depends="clean, package" |
17 |
| - description="Performs clean build, runs tests and packages for distribution"/> |
18 |
| - |
19 |
| - <target name="clean" |
20 |
| - description="Clean up all built files"> |
| 9 | + <target name="clean" description="Clean up all built files"> |
21 | 10 | <delete dir="build"/>
|
22 | 11 | </target>
|
23 | 12 |
|
24 |
| - <target name="generator" |
25 |
| - description="Build code generator tool"> |
| 13 | + <target name="generator" description="Build code generator tool"> |
26 | 14 | <java-to-jar srcdir="hamcrest-generator/src/main/java"
|
27 | 15 | destjar="build/temp/hamcrest-generator-${version}-nodeps.jar"
|
28 |
| - classpath=" |
29 |
| - lib/generator/qdox-1.12.jar; |
30 |
| - "/> |
31 |
| - <taskdef name="jarjar" |
32 |
| - classname="com.tonicsystems.jarjar.JarJarTask" |
33 |
| - classpath="lib/generator/jarjar-1.3.jar"/> |
34 |
| - <!-- Bundle QDox classes in hamcrest-generator.jar so user doesn't need to care |
35 |
| - about it's existence. Uses JarJar to place classes under a different package |
36 |
| - to prevent conflict. --> |
| 16 | + classpath="lib/generator/qdox-1.12.jar"/> |
| 17 | + |
| 18 | + <!-- Bundle QDox classes in hamcrest-generator.jar using JarJar to place classes under a different package --> |
| 19 | + <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/generator/jarjar-1.3.jar"/> |
37 | 20 | <jarjar jarfile="build/hamcrest-generator-${version}.jar">
|
38 | 21 | <zipfileset src="build/temp/hamcrest-generator-${version}-nodeps.jar"/>
|
39 | 22 | <zipfileset src="lib/generator/qdox-1.12.jar"/>
|
40 |
| - <rule pattern="com.thoughtworks.qdox.**" |
41 |
| - result="org.hamcrest.generator.qdox.@1"/> |
| 23 | + <rule pattern="com.thoughtworks.qdox.**" result="org.hamcrest.generator.qdox.@1"/> |
42 | 24 | </jarjar>
|
43 | 25 | </target>
|
44 | 26 |
|
45 |
| - <target name="core" |
46 |
| - depends="generator" |
47 |
| - description="Build core Hamcrest library"> |
48 |
| - <java-to-jar srcdir="hamcrest-core/src/main/java" |
49 |
| - destjar="build/hamcrest-core-${version}.jar"/> |
| 27 | + <target name="core" depends="generator" description="Build core Hamcrest library"> |
| 28 | + <java-to-jar srcdir="hamcrest-core/src/main/java" destjar="build/hamcrest-core-${version}.jar"/> |
| 29 | + |
50 | 30 | <!-- Generate one class with all static imports -->
|
51 | 31 | <mkdir dir="build/temp/hamcrest-core/generated-code"/>
|
52 | 32 |
|
|
95 | 75 | classpath="build/hamcrest-core-${version}.jar"/>
|
96 | 76 | </target>
|
97 | 77 |
|
98 |
| - <target name="integration" |
99 |
| - depends="core, library" |
100 |
| - description="Build integration with external tools"> |
101 |
| - <java-to-jar srcdir="hamcrest-integration/src/main/java" |
102 |
| - destjar="build/hamcrest-integration-${version}.jar" |
| 78 | + <target name="integration" depends="core, library" description="Build integration with external tools"> |
| 79 | + <java-to-jar srcdir="hamcrest-integration/src/main/java" destjar="build/hamcrest-integration-${version}.jar" |
103 | 80 | classpath="
|
104 | 81 | build/hamcrest-core-${version}.jar;
|
105 | 82 | build/hamcrest-library-${version}.jar"/>
|
106 | 83 | </target>
|
107 | 84 |
|
108 |
| - <target name="unit-test" |
109 |
| - depends="core, library, integration, generator" |
110 |
| - description="Build and run unit tests."> |
111 |
| - <java-to-jar srcdir="hamcrest-unit-test/src/main/java" |
112 |
| - destjar="build/hamcrest-unit-test-${version}.jar" |
| 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="build/hamcrest-unit-test-${version}.jar" |
113 | 87 | classpath="
|
114 | 88 | build/hamcrest-core-${version}.jar;
|
115 | 89 | build/hamcrest-library-${version}.jar;
|
|
136 | 110 | </junit>
|
137 | 111 | </target>
|
138 | 112 |
|
139 |
| - <target name="examples" |
140 |
| - depends="core, library, integration" |
141 |
| - description="Build and run unit tests."> |
| 113 | + <target name="examples" depends="core, library, integration" description="Build and run unit tests."> |
142 | 114 | <java-to-jar srcdir="hamcrest-examples/src/main/java"
|
143 | 115 | destjar="build/hamcrest-examples-${version}.jar"
|
144 | 116 | classpath="
|
|
147 | 119 | build/hamcrest-integration-${version}.jar"/>
|
148 | 120 | </target>
|
149 | 121 |
|
150 |
| - <target name="bigjar" |
151 |
| - depends="core, library, integration, generator" |
| 122 | + <target name="bigjar" depends="core, library, integration, generator" |
152 | 123 | description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration.">
|
153 | 124 | <jar jarfile="build/hamcrest-all-${version}.jar" duplicate="preserve">
|
154 | 125 | <zipfileset src="build/hamcrest-core-${version}.jar"/>
|
|
158 | 129 | </jar>
|
159 | 130 | </target>
|
160 | 131 |
|
161 |
| - <target name="package" |
162 |
| - depends="core, generator, library, integration, bigjar, unit-test, examples" |
163 |
| - description="Package for distribution"> |
| 132 | + <target name="package" depends="core, generator, library, integration, bigjar, unit-test, examples" description="Package for distribution"> |
164 | 133 | <zip zipfile="build/hamcrest-${version}.zip">
|
165 | 134 | <zipfileset dir="." prefix="hamcrest-${version}">
|
166 | 135 | <include name="hamcrest-*/**"/>
|
|
220 | 189 | </javadoc>
|
221 | 190 | </target>
|
222 | 191 |
|
223 |
| - <macrodef name="java-to-jar" |
224 |
| - description="Compile Java source and build a Jar"> |
| 192 | + <macrodef name="java-to-jar" description="Compile Java source and build a Jar"> |
225 | 193 | <attribute name="srcdir" description="Directory containg Java source"/>
|
226 | 194 | <attribute name="destjar" description="Path to Jar"/>
|
227 | 195 | <attribute name="classpath" description="Anything additional to add on the classpath" default=""/>
|
|
0 commit comments