Skip to content

Commit 8efffe9

Browse files
committed
tidy up build.xml a bit
1 parent 1c5b76f commit 8efffe9

File tree

1 file changed

+22
-54
lines changed

1 file changed

+22
-54
lines changed

build.xml

Lines changed: 22 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,32 @@
11
<project name="hamcrest" default="all">
22

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"/>
66

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"/>
108

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">
2110
<delete dir="build"/>
2211
</target>
2312

24-
<target name="generator"
25-
description="Build code generator tool">
13+
<target name="generator" description="Build code generator tool">
2614
<java-to-jar srcdir="hamcrest-generator/src/main/java"
2715
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"/>
3720
<jarjar jarfile="build/hamcrest-generator-${version}.jar">
3821
<zipfileset src="build/temp/hamcrest-generator-${version}-nodeps.jar"/>
3922
<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"/>
4224
</jarjar>
4325
</target>
4426

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+
5030
<!-- Generate one class with all static imports -->
5131
<mkdir dir="build/temp/hamcrest-core/generated-code"/>
5232

@@ -95,21 +75,15 @@
9575
classpath="build/hamcrest-core-${version}.jar"/>
9676
</target>
9777

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"
10380
classpath="
10481
build/hamcrest-core-${version}.jar;
10582
build/hamcrest-library-${version}.jar"/>
10683
</target>
10784

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"
11387
classpath="
11488
build/hamcrest-core-${version}.jar;
11589
build/hamcrest-library-${version}.jar;
@@ -136,9 +110,7 @@
136110
</junit>
137111
</target>
138112

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.">
142114
<java-to-jar srcdir="hamcrest-examples/src/main/java"
143115
destjar="build/hamcrest-examples-${version}.jar"
144116
classpath="
@@ -147,8 +119,7 @@
147119
build/hamcrest-integration-${version}.jar"/>
148120
</target>
149121

150-
<target name="bigjar"
151-
depends="core, library, integration, generator"
122+
<target name="bigjar" depends="core, library, integration, generator"
152123
description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration.">
153124
<jar jarfile="build/hamcrest-all-${version}.jar" duplicate="preserve">
154125
<zipfileset src="build/hamcrest-core-${version}.jar"/>
@@ -158,9 +129,7 @@
158129
</jar>
159130
</target>
160131

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">
164133
<zip zipfile="build/hamcrest-${version}.zip">
165134
<zipfileset dir="." prefix="hamcrest-${version}">
166135
<include name="hamcrest-*/**"/>
@@ -220,8 +189,7 @@
220189
</javadoc>
221190
</target>
222191

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">
225193
<attribute name="srcdir" description="Directory containg Java source"/>
226194
<attribute name="destjar" description="Path to Jar"/>
227195
<attribute name="classpath" description="Anything additional to add on the classpath" default=""/>

0 commit comments

Comments
 (0)