-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
303 lines (274 loc) · 11.2 KB
/
build.xml
File metadata and controls
303 lines (274 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<?xml version="1.0"?>
<!--
This file is licensed to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="xmlunit" default="test" basedir=".">
<!-- allow properties to be overridden in a properties file -->
<property file="build.properties"/>
<!-- Version -->
<property name="xmlunit.version" value="2.0alpha"/>
<!-- some locations -->
<property name="src.dir" value="src/main"/>
<property name="test.dir" value="src/tests"/>
<property name="build.dir" location="build/java"/>
<property name="gen.src.dir" value="${build.dir}/generated"/>
<property name="lib.dir" value="${build.dir}/lib"/>
<property name="core.out.dir" value="${build.dir}/core-classes"/>
<property name="legacy.out.dir" value="${build.dir}/legacy-classes"/>
<property name="coretest.out.dir" value="${build.dir}/core-test-classes"/>
<property name="legacytest.out.dir" value="${build.dir}/legacy-test-classes"/>
<property name="userguide.out.dir" value="${build.dir}/ug-classes"/>
<property name="test.report.dir" value="${build.dir}/test-report"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="docs.dir" value="${build.dir}/doc"/>
<property name="userguide.docs.dir" value="${docs.dir}/userguide"/>
<!-- javac properties -->
<property name="javac.source" value="5"/>
<property name="javac.target" value="5"/>
<property name="javac.debug" value="true"/>
<!-- junit task properties -->
<property name="junit.fork" value="yes"/>
<!-- Docbook related properties, macros and targets -->
<import file="docbook.xml"/>
<target name="-props">
<available property="regexp.present" classname="java.util.regex.Matcher"/>
</target>
<target name="-init" depends="-props">
<mkdir dir="${lib.dir}"/>
<mkdir dir="${core.out.dir}"/>
<mkdir dir="${legacy.out.dir}"/>
<mkdir dir="${coretest.out.dir}"/>
<mkdir dir="${legacytest.out.dir}"/>
<mkdir dir="${test.report.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${docs.dir}"/>
<mkdir dir="${userguide.docs.dir}"/>
<mkdir dir="${gen.src.dir}"/>
</target>
<target name="clean"
description="removes created directories">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${lib.dir}"/>
<fileset dir="${core.out.dir}"/>
<fileset dir="${legacy.out.dir}"/>
<fileset dir="${coretest.out.dir}"/>
<fileset dir="${legacytest.out.dir}"/>
<fileset dir="${test.report.dir}"/>
<fileset dir="${dist.dir}"/>
<fileset dir="${docs.dir}"/>
<fileset dir="${userguide.docs.dir}"/>
<fileset dir="${build.dir}"/>
</delete>
</target>
<target name="compile-core" depends="-init"
description="compiles core sources">
<javac srcdir="${src.dir}/java-core:${gen.src.dir}"
destdir="${core.out.dir}"
includeantruntime="false"
debug="${javac.debug}" target="${javac.target}"
source="${javac.source}">
</javac>
</target>
<target name="compile-legacy" depends="compile-core"
description="compiles legacy sources">
<javac srcdir="${src.dir}/java-legacy" destdir="${legacy.out.dir}"
includeantruntime="false" debug="${javac.debug}"
target="${javac.target}" source="${javac.source}">
<classpath>
<pathelement location="${core.out.dir}"/>
<pathelement path="${java.class.path}"/>
<fileset dir="lib" includes="junit-3*.jar"/>
</classpath>
<exclude name="**/*XPathRegexAssert.java" unless="regexp.present"/>
</javac>
</target>
<target name="compile-legacy-tests" depends="compile-legacy"
description="Compiles the test for XMLUnit 1.x">
<javac srcdir="${test.dir}/java-legacy" destdir="${legacytest.out.dir}"
includeantruntime="false" debug="${javac.debug}"
target="${javac.target}" source="${javac.source}">
<classpath>
<pathelement location="${core.out.dir}"/>
<pathelement location="${legacy.out.dir}"/>
<pathelement path="${java.class.path}"/>
<fileset dir="lib" includes="junit-3*.jar"/>
</classpath>
<exclude name="**/*XPathRegexAssert.java" unless="regexp.present"/>
</javac>
</target>
<target name="compile-core-tests" depends="compile-core"
description="Compiles the test for XMLUnit2">
<javac srcdir="${test.dir}/java-core" destdir="${coretest.out.dir}"
includeantruntime="false"
debug="${javac.debug}" target="${javac.target}"
source="${javac.source}">
<classpath>
<pathelement location="${core.out.dir}"/>
<pathelement path="${java.class.path}"/>
<fileset dir="lib" includes="junit-4*.jar"/>
</classpath>
</javac>
</target>
<target name="compile" depends="compile-core,compile-legacy"/>
<target name="compile-tests"
depends="compile-core-tests,compile-legacy-tests"/>
<target name="test" depends="compile-tests" description="runs the tests">
<junit printsummary="yes" haltonfailure="no" fork="${junit.fork}"
forkMode="perBatch" failureproperty="tests.failed">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="user.dir" value="${basedir}"/>
<classpath>
<pathelement location="${core.out.dir}"/>
<pathelement location="${legacy.out.dir}"/>
<pathelement location="${legacytest.out.dir}"/>
<pathelement location="${coretest.out.dir}"/>
<pathelement path="${java.class.path}"/>
<fileset dir="lib" includes="junit-4*.jar"/>
</classpath>
<formatter type="xml"/>
<batchtest todir="${test.report.dir}">
<fileset dir="${test.dir}/java-legacy">
<include name="**/test_*.java"/>
</fileset>
<fileset dir="${test.dir}/java-core">
<include name="**/*Test.java"/>
<exclude name="**/Abstract*.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.report.dir}">
<fileset dir="${test.report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report.dir}/html"/>
</junitreport>
<fail if="tests.failed">Some tests failed</fail>
</target>
<target name="docs"
depends="create-users-guide,javadocs,-site"
description="creates the documentation bundle"/>
<target name="javadocs" depends="-init"
description="creates the API documentation">
<delete includeEmptyDirs="true" dir="${docs.dir}/api"/>
<javadoc destdir="${docs.dir}/api"
overview="${src.dir}/java-legacy/overview.html"
windowtitle="XMLUnit Documentation"
footer="<p><a href="http://xmlunit.sourceforge.net/">XMLUnit</a> is hosted by sourceforge.net</p>">
<group title="XMLUnit v${xmlunit.version}"
packages="org.custommonkey.xmlunit*"/>
<fileset dir="${src.dir}/java-legacy">
<include name="org/custommonkey/**/*.java"/>
</fileset>
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path="${java.class.path}"/>
</classpath>
</javadoc>
</target>
<target name="-site" depends="-init">
<copy todir="${docs.dir}">
<fileset dir="${src.dir}/site">
<include name="*.html"/>
<include name="*.png"/>
</fileset>
</copy>
</target>
<target name="jar" depends="compile"
description="creates jar, Maven2 POM and Ivy file">
<jar jarfile="${lib.dir}/xmlunit-core-${xmlunit.version}.jar"
basedir="${core.out.dir}"
/>
<jar jarfile="${lib.dir}/xmlunit-legacy-${xmlunit.version}.jar"
basedir="${legacy.out.dir}"
/>
<jar jarfile="${lib.dir}/xmlunit-sumo-${xmlunit.version}.jar">
<fileset dir="${core.out.dir}"/>
<fileset dir="${legacy.out.dir}"/>
</jar>
<tstamp>
<format property="ivy.publication.datetime" pattern="yyyyMMddHHmmss"/>
</tstamp>
<copy todir="${lib.dir}">
<fileset dir="${src.dir}/etc">
<include name="xmlunit.pom"/>
<include name="xmlunit-ivy.xml"/>
<include name="xmlunit-maven-metadata.xml"/>
</fileset>
<mapper type="glob" from="xmlunit*" to="xmlunit-${xmlunit.version}*"/>
<filterset>
<filter token="VERSION" value="${xmlunit.version}"/>
<filter token="DATE" value="${ivy.publication.datetime}"/>
<filter token="DESCRIPTION" value="XMLUnit compares a control XML document to a test document or the result of a transformation, validates documents, and compares the results of XPath expressions."/>
<filter token="LICENSE" value="BSD License"/>
<filter token="LICENSE_URL" value="http://xmlunit.svn.sourceforge.net/viewvc/*checkout*/xmlunit/trunk/xmlunit/LICENSE.txt"/>
<filter token="GROUP" value="xmlunit"/>
<filter token="ARTIFACT" value="xmlunit"/>
<filter token="TYPE" value="jar"/>
</filterset>
</copy>
</target>
<target name="bindist" depends="jar,test,docs">
<zip zipfile="${dist.dir}/xmlunit-${xmlunit.version}-bin.zip">
<zipfileset prefix="xmlunit-${xmlunit.version}/lib"
dir="${lib.dir}"/>
<zipfileset prefix="xmlunit-${xmlunit.version}/docs"
dir="${docs.dir}"/>
<zipfileset prefix="xmlunit-${xmlunit.version}" dir=".">
<include name="KEYS"/>
<include name="LICENSE.txt"/>
<include name="README.txt"/>
</zipfileset>
</zip>
</target>
<target name="srcdist" depends="-init,create-users-guide">
<zip zipfile="${dist.dir}/xmlunit-${xmlunit.version}-src.zip">
<zipfileset prefix="xmlunit-${xmlunit.version}" dir=".">
<include name="*.xml"/>
<include name="${src.dir}/"/>
<include name="${test.dir}/"/>
<include name="KEYS"/>
<include name="LICENSE.txt"/>
<include name="README.txt"/>
<exclude name="**/csharp/**"/>
</zipfileset>
<zipfileset dir="${userguide.docs.dir}"
prefix="xmlunit-${xmlunit.version}/userguide"/>
</zip>
</target>
<target name="dist"
depends="clean,bindist,srcdist,compile-userguide-examples"
description="creates the distribution files">
<checksum algorithm="md5">
<fileset dir="${dist.dir}">
<include name="*.zip"/>
</fileset>
</checksum>
<checksum algorithm="sha1">
<fileset dir="${dist.dir}">
<include name="*.zip"/>
</fileset>
</checksum>
</target>
<target name="compile-userguide-examples" depends="compile">
<mkdir dir="${userguide.out.dir}"/>
<javac srcdir="src/user-guide" includes="org/"
includeantruntime="false"
destdir="${userguide.out.dir}" source="1.3" target="1.2">
<classpath>
<pathelement location="${legacy.out.dir}"/>
<fileset dir="lib" includes="junit-3*.jar"/>
</classpath>
</javac>
<delete dir="${userguide.out.dir}"/>
</target>
</project>