forked from xspec/xspec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
591 lines (502 loc) · 25.2 KB
/
build.xml
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- File: build.xml -->
<!-- Author: Jeni Tennison -->
<!-- Tags: -->
<!-- Copyright (c) 2008, 2010 Jeni Tennison (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<project name="xspec" default="xspec" xmlns:if="ant:if" xmlns:unless="ant:unless">
<description><![CDATA[
Usage:
* Command-line
https://github.com/xspec/xspec/wiki/Running-with-Ant
* Oxygen XSLT transformation scenario
https://github.com/xspec/xspec/wiki/Running-with-Oxygen
]]></description>
<!-- "xspec.project.dir" property: Documented in Wiki. DO NOT RENAME.
Directory where XSpec repository is cloned. -->
<dirname property="xspec.project.dir" file="${ant.file.xspec}" />
<!-- "xspec.properties" property: Documented. DO NOT RENAME.
Absolute or relative path of Ant properties file -->
<property name="xspec.properties" location="${xspec.project.dir}/xspec.properties" />
<property file="${xspec.properties}" />
<!-- "xspec.xml" property: Documented in Wiki. DO NOT RENAME.
No default value. This property is always provided by the user.
This property name is vague. Use the alias property "xspec.xspecfile.original" for internal use. -->
<!-- "saxon.custom.options" property: Documented in Wiki. DO NOT RENAME.
Optional command-line arguments passed to Saxon when running the tests.
For example, -warnings:recover -strip:none -opt:10 -dtd:off -l:off -versionmsg:off -expand:on
-outval:fatal -val:lax
No default value. This property is occasionally provided by the user. -->
<!-- "catalog" property: Documented in Wiki. DO NOT RENAME.
One or more XML catalog files. Separated by semicolons (;).
Value is either file path or URI. Must not mix file path and URI. -->
<!-- File path of the original XSpec file specified by the user -->
<property name="xspec.xspecfile.original" value="${xspec.xml}" />
<!-- Directory of the original XSpec file -->
<dirname property="xspec.xspecfile.dir" file="${xspec.xspecfile.original}" />
<!-- File name (with extension) of the original XSpec file -->
<basename property="xspec.xspecfile.name" file="${xspec.xspecfile.original}" />
<!-- File name (without extension) of the original XSpec file -->
<basename property="xspec.xspecfile.name.without.xml"
file="${xspec.xspecfile.name}"
suffix=".xml" />
<basename property="xspec.xspecfile.name.without.ext"
file="${xspec.xspecfile.name.without.xml}"
suffix=".xspec" />
<!-- "xspec.dir" property: Documented in Wiki. DO NOT RENAME.
This property name is vague. Use the alias property "xspec.output.dir" for internal use. -->
<property name="xspec.dir" value="${xspec.xspecfile.dir}/xspec" />
<!-- Directory where various output files are created -->
<property name="xspec.output.dir" value="${xspec.dir}" />
<!-- Whether to create the coverage report or not -->
<property name="xspec.coverage.enabled" value="false" />
<!-- Whether to create the JUnit report or not -->
<property name="xspec.junit.enabled" value="false" />
<!-- File path of the XML report file -->
<property name="xspec.result.xml"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-result.xml" />
<!-- File path of the coverage XML file -->
<property name="xspec.coverage.xml"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-coverage.xml" />
<!-- "xspec.result.html" property: Documented in Wiki. DO NOT RENAME.
File path of the test result HTML file -->
<property name="xspec.result.html"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-result.html" />
<!-- "xspec.coverage.html" property: Documented in Wiki. DO NOT RENAME.
File path of the coverage report HTML file -->
<property name="xspec.coverage.html"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-coverage.html" />
<!-- File path of the JUnit report file -->
<property name="xspec.result.junit"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-junit.xml" />
<!-- "clean.output.dir" property: Documented in Wiki. DO NOT RENAME.
Controls whether to delete the output files -->
<property name="clean.output.dir" value="false" />
<!-- File path of XSLT file for formatting the test result HTML file -->
<property name="xspec.html.reporter.xsl"
value="${xspec.project.dir}/src/reporter/format-xspec-report.xsl" />
<!-- File path of XSLT file for formatting the coverage report HTML file -->
<property name="xspec.coverage.reporter.xsl"
value="${xspec.project.dir}/src/reporter/coverage-report.xsl" />
<!-- File path of XSLT file for formatting the JUnit report file -->
<property name="xspec.junit.reporter.xsl"
value="${xspec.project.dir}/src/reporter/junit-report.xsl" />
<!-- "test.type" property: Documented in Wiki. DO NOT RENAME.
Specifies XSLT, XQuery or Schematron -->
<property name="test.type" value="t" />
<!-- Properties indicating whether the test type is a specific type -->
<condition property="xspec.is.schematron" else="false">
<or>
<equals arg1="${test.type}" arg2="s" />
<equals arg1="${test.type}" arg2="schematron" casesensitive="no" />
</or>
</condition>
<condition property="xspec.is.xquery" else="false">
<or>
<equals arg1="${test.type}" arg2="q" />
<equals arg1="${test.type}" arg2="xquery" casesensitive="no" />
</or>
</condition>
<condition property="xspec.is.xslt" else="false">
<or>
<equals arg1="${test.type}" arg2="t" />
<equals arg1="${test.type}" arg2="xslt" casesensitive="no" />
</or>
</condition>
<!-- "xspec.fail" property: Documented in Wiki. DO NOT RENAME.
Controls whether to make the build fail when one or more tests failed -->
<property name="xspec.fail" value="true" />
<!-- File path of the XSpec file after preprocessing.
XSLT and XQuery: This property is just the alias of the original XSpec file.
Schematron: This file is created while preprocessing at preprocess-schematron-xspec and deleted by cleanup. -->
<condition property="xspec.xspecfile.preprocessed"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-sch-preprocessed.xspec"
else="${xspec.xspecfile.original}">
<istrue value="${xspec.is.schematron}" />
</condition>
<!-- True if "catalog" property consists of URIs. Otherwise file paths. -->
<property name="catalog.is.uri" value="false" />
<!-- One or more XML catalog file paths (not URLs). Separated by semicolons (;) -->
<condition property="xspec.catalog.files"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}_catalog.xml"
else="${catalog}"
if:set="catalog">
<istrue value="${catalog.is.uri}" />
</condition>
<!-- True if a temporary catalog file needs to be generated -->
<condition property="xspec.generate.catalog" else="false">
<and>
<isset property="catalog" />
<istrue value="${catalog.is.uri}" />
</and>
</condition>
<!-- File path of the compiled XSLT/XQuery file that finally runs the tests -->
<property name="xspec.compiled.runner.without.ext"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-compiled" />
<condition property="xspec.compiled.runner"
value="${xspec.compiled.runner.without.ext}.xq"
else="${xspec.compiled.runner.without.ext}.xsl">
<istrue value="${xspec.is.xquery}" />
</condition>
<!-- Performs XSLT using Saxon with common parameters including catalog -->
<macrodef name="saxon-xslt">
<attribute name="in" />
<attribute name="out" />
<attribute name="style" />
<attribute name="ignore-catalog" default="false" />
<element name="factory-elements" optional="true" />
<element name="xslt-elements" optional="true" />
<sequential>
<local name="enable-catalog" />
<condition property="enable-catalog" else="false">
<and>
<isfalse value="@{ignore-catalog}" />
<isset property="xspec.catalog.files" />
</and>
</condition>
<xslt in="@{in}" out="@{out}" style="@{style}" force="true">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<factory-elements />
<!-- Place <attribute> after <factory-elements/>, otherwise xspec.compiler.saxon.config
seems to reset preceding <attribute>. -->
<attribute name="http://saxon.sf.net/feature/xml-version"
value="${xspec.xml.version}"
if:set="xspec.xml.version" />
<!-- For debugging -->
<!--<attribute name="http://saxon.sf.net/feature/timing"
value="true"/>-->
</factory>
<xmlcatalog if:true="${enable-catalog}">
<catalogpath path="${xspec.catalog.files}" />
</xmlcatalog>
<xslt-elements />
</xslt>
</sequential>
</macrodef>
<!-- Transforms the input XML using the given XSLT and loads the output XML as Ant properties -->
<macrodef name="xml-to-properties">
<attribute name="in" />
<attribute name="style" />
<sequential>
<!-- <tempfile deleteonexit=false> accumulates temp files. <tempfile deleteonexit=true> makes
debugging a bit harder. Hence a fixed path. -->
<property name="xspec.xml-to-properties.temp"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}_xml-to-properties.xml" />
<saxon-xslt in="@{in}"
out="${xspec.xml-to-properties.temp}"
style="${xspec.project.dir}/src/ant/@{style}" />
<xmlproperty file="${xspec.xml-to-properties.temp}" />
</sequential>
</macrodef>
<!-- Prepares the environment before compilation -->
<target name="init">
<condition property="xspec.coverage.dispchar" value="c" else="">
<istrue value="${xspec.coverage.enabled}" />
</condition>
<echo message="Testing ${xspec.xspecfile.name} [${test.type}${xspec.coverage.dispchar}]" />
<!-- Verify "test.type" -->
<fail message="Invalid test.type: '${test.type}'">
<condition>
<and>
<isfalse value="${xspec.is.schematron}" />
<isfalse value="${xspec.is.xquery}" />
<isfalse value="${xspec.is.xslt}" />
</and>
</condition>
</fail>
<!-- Verify "xspec.coverage.enabled" -->
<fail message="Coverage is supported only for XSLT">
<condition>
<and>
<istrue value="${xspec.coverage.enabled}" />
<isfalse value="${xspec.is.xslt}" />
</and>
</condition>
</fail>
<!-- Verify .xspec file existence, to avoid creating a useless output directory -->
<available property="xspec.xspecfile.is.available"
file="${xspec.xspecfile.original}" type="file" />
<fail message="XSpec file not found: '${xspec.xspecfile.original}'"
unless="xspec.xspecfile.is.available" />
<!-- Create the output directory.
Need to retry, for the creation may fail temporarily while running the build repeatedly
with clean.output.dir=true. -->
<retry retrycount="2" retrydelay="1000">
<mkdir dir="${xspec.output.dir}" />
</retry>
</target>
<!-- Generates a temporary catalog file which references all URIs in "catalog" property -->
<target name="generate-catalog" if="${xspec.generate.catalog}">
<makeurl property="basedir.uri" file="${basedir}/" />
<!-- @in doesn't matter -->
<saxon-xslt in="${ant.file}"
out="${xspec.catalog.files}"
style="${xspec.project.dir}/src/ant/generate-catalog.xsl"
ignore-catalog="true">
<factory-elements>
<attribute name="http://saxon.sf.net/feature/initialTemplate"
value="{http://www.w3.org/1999/XSL/Transform}initial-template" />
</factory-elements>
<xslt-elements>
<param name="CATALOG-URIS" expression="${catalog}" />
<param name="BASE-URI" expression="${basedir.uri}" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Converts Schematron into XSLT -->
<target name="preprocess-schematron-xslt"
if="${xspec.is.schematron}">
<!-- Mark URI of preprocessors to be skipped -->
<condition property="xspec.schematron.preprocessor.step1.url" value="#none">
<equals arg1="${xspec.schematron.preprocessor.step1}" arg2="#none" />
</condition>
<condition property="xspec.schematron.preprocessor.step2.url" value="#none">
<equals arg1="${xspec.schematron.preprocessor.step2}" arg2="#none" />
</condition>
<!-- URI of preprocessors -->
<makeurl property="xspec.schematron.preprocessor.step1.url"
file="${xspec.schematron.preprocessor.step1}"
if:set="xspec.schematron.preprocessor.step1" />
<makeurl property="xspec.schematron.preprocessor.step2.url"
file="${xspec.schematron.preprocessor.step2}"
if:set="xspec.schematron.preprocessor.step2" />
<makeurl property="xspec.schematron.preprocessor.step3.url"
file="${xspec.schematron.preprocessor.step3}"
if:set="xspec.schematron.preprocessor.step3" />
<!-- Location of the generated XSLT file -->
<property name="xspec.schematron.preprocessed.xsl.file"
value="${xspec.output.dir}/${xspec.xspecfile.name.without.ext}-sch-preprocessed.xsl" />
<saxon-xslt in="${xspec.xspecfile.original}"
out="${xspec.schematron.preprocessed.xsl.file}"
style="${xspec.project.dir}/src/schematron/schut-to-xslt.xsl">
<xslt-elements>
<param name="STEP1-PREPROCESSOR-URI" expression="${xspec.schematron.preprocessor.step1.url}"
if:set="xspec.schematron.preprocessor.step1.url" />
<param name="STEP2-PREPROCESSOR-URI" expression="${xspec.schematron.preprocessor.step2.url}"
if:set="xspec.schematron.preprocessor.step2.url" />
<param name="STEP3-PREPROCESSOR-URI" expression="${xspec.schematron.preprocessor.step3.url}"
if:set="xspec.schematron.preprocessor.step3.url" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Converts Schematron XSpec into XSLT XSpec -->
<target name="preprocess-schematron-xspec"
depends="preprocess-schematron-xslt"
if="${xspec.is.schematron}">
<makeurl property="xspec.schematron.preprocessed.xsl.url"
file="${xspec.schematron.preprocessed.xsl.file}" />
<saxon-xslt in="${xspec.xspecfile.original}"
out="${xspec.xspecfile.preprocessed}"
style="${xspec.project.dir}/src/schematron/schut-to-xspec.xsl">
<xslt-elements>
<param name="stylesheet-uri" expression="${xspec.schematron.preprocessed.xsl.url}" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Compiles the XSpec file into the test runner file written in XSLT or XQuery -->
<target name="compile" depends="init, generate-catalog, preprocess-schematron-xspec">
<property name="xspec.compiler.dir"
value="${xspec.project.dir}/src/compiler" />
<property name="xspec.xquery.compiler.xsl"
value="${xspec.compiler.dir}/compile-xquery-tests.xsl" />
<property name="xspec.xslt.compiler.xsl"
value="${xspec.compiler.dir}/compile-xslt-tests.xsl" />
<condition property="xspec.compiler.xsl"
value="${xspec.xquery.compiler.xsl}"
else="${xspec.xslt.compiler.xsl}">
<istrue value="${xspec.is.xquery}" />
</condition>
<property name="xspec.compiler.saxon.config.absolute"
location="${xspec.compiler.saxon.config}"
if:set="xspec.compiler.saxon.config" />
<echo message="Compiling Tests..."
level="info" />
<saxon-xslt in="${xspec.xspecfile.preprocessed}"
out="${xspec.compiled.runner}"
style="${xspec.compiler.xsl}">
<factory-elements>
<attribute name="http://saxon.sf.net/feature/configuration-file"
value="${xspec.compiler.saxon.config.absolute}"
if:set="xspec.compiler.saxon.config.absolute" />
</factory-elements>
<xslt-elements>
<param name="force-focus" expression="${xspec.force.focus}"
if="xspec.force.focus" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Runs the compiled XSpec for XQuery -->
<target name="run-xquery-test" depends="compile" if="${xspec.is.xquery}">
<echo message="Running XQuery Tests..."
level="info" />
<java classname="net.sf.saxon.Query" fork="true" failonerror="true">
<!-- Saxon should be included in the classpath -->
<classpath>
<pathelement path="${java.class.path}" />
<pathelement path="${xspec.additional.classpath}" if:set="xspec.additional.classpath" />
</classpath>
<arg line="${saxon.custom.options}" if:set="saxon.custom.options" />
<arg value="-catalog:${xspec.catalog.files}" if:set="xspec.catalog.files" />
<arg value="-o:${xspec.result.xml}" />
<arg value="-q:${xspec.compiled.runner}" />
<arg value="-xmlversion:${xspec.xml.version}" if:set="xspec.xml.version" />
</java>
</target>
<!-- Runs the compiled XSpec for XSLT -->
<target name="run-xslt-test" depends="compile" unless="${xspec.is.xquery}">
<echo message="Running XSLT Tests..."
level="info" />
<!-- Absolute path for code coverage, with '/' and '\' adapted to
the current platform -->
<property name="xspec.output.dir.absolute"
location="${xspec.output.dir}"
if:true="${xspec.coverage.enabled}" />
<property name="xspec.coverage.xml.absolute"
location="${xspec.coverage.xml}"
if:true="${xspec.coverage.enabled}" />
<property name="xspec.xspecfile.absolute"
location="${xspec.xspecfile.original}"
if:true="${xspec.coverage.enabled}" />
<!-- URL of XSpec repository root -->
<makeurl property="xspec.project.dir.url"
file="${xspec.project.dir}"
if:true="${xspec.coverage.enabled}" />
<echo message="Collecting test coverage data..."
level="info"
if:true="${xspec.coverage.enabled}" />
<!-- Can't specify saxon.custom.options with <xslt> task so have to
fall back to running Saxon as Java app. -->
<java classname="net.sf.saxon.Transform" fork="true" failonerror="true">
<!-- Saxon should be included in the classpath -->
<classpath>
<pathelement path="${java.class.path}" />
<pathelement path="${xspec.additional.classpath}" if:set="xspec.additional.classpath" />
<pathelement location="${xspec.project.dir}/java" if:true="${xspec.coverage.enabled}" />
</classpath>
<!-- System property for code coverage -->
<sysproperty key="xspec.coverage.ignore"
value="${xspec.output.dir.absolute}"
if:true="${xspec.coverage.enabled}" />
<sysproperty key="xspec.coverage.xml"
value="${xspec.coverage.xml.absolute}"
if:true="${xspec.coverage.enabled}" />
<sysproperty key="xspec.home.uri"
value="${xspec.project.dir.url}"
if:true="${xspec.coverage.enabled}" />
<sysproperty key="xspec.xspecfile"
value="${xspec.xspecfile.absolute}"
if:true="${xspec.coverage.enabled}" />
<arg line="${saxon.custom.options}" if:set="saxon.custom.options" />
<arg value="-catalog:${xspec.catalog.files}" if:set="xspec.catalog.files" />
<arg value="-it:{http://www.jenitennison.com/xslt/xspec}main" />
<arg value="-o:${xspec.result.xml}" />
<arg value="-xmlversion:${xspec.xml.version}" if:set="xspec.xml.version" />
<arg value="-xsl:${xspec.compiled.runner}" />
<arg value="-T:com.jenitennison.xslt.tests.XSLTCoverageTraceListener"
if:true="${xspec.coverage.enabled}" />
</java>
</target>
<!-- Report: Test result HTML -->
<target name="report-html"
depends="run-xquery-test, run-xslt-test">
<makeurl property="xspec.result.html.css.url"
file="${xspec.result.html.css}"
if:set="xspec.result.html.css" />
<saxon-xslt in="${xspec.result.xml}"
out="${xspec.result.html}"
style="${xspec.html.reporter.xsl}">
<xslt-elements>
<param name="force-focus" expression="${xspec.force.focus}"
if="xspec.force.focus" />
<param name="inline-css" expression="true" />
<param name="report-css-uri" expression="${xspec.result.html.css.url}"
if="xspec.result.html.css.url" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Report: Coverage HTML -->
<target name="report-coverage"
depends="run-xslt-test"
if="${xspec.coverage.enabled}">
<makeurl property="xspec.coverage.html.css.url"
file="${xspec.coverage.html.css}"
if:set="xspec.coverage.html.css" />
<saxon-xslt in="${xspec.coverage.xml}"
out="${xspec.coverage.html}"
style="${xspec.coverage.reporter.xsl}">
<factory-elements>
<attribute name="http://saxon.sf.net/feature/configuration-file"
value="${xspec.project.dir}/src/reporter/coverage-report-config.xml" />
</factory-elements>
<xslt-elements>
<classpath>
<pathelement path="${java.class.path}" />
<pathelement location="${xspec.project.dir}/java" />
</classpath>
<param name="inline-css" expression="true" />
<param name="report-css-uri" expression="${xspec.coverage.html.css.url}"
if="xspec.coverage.html.css.url" />
</xslt-elements>
</saxon-xslt>
</target>
<!-- Report: JUnit -->
<target name="report-junit"
depends="run-xquery-test, run-xslt-test"
if="${xspec.junit.enabled}">
<saxon-xslt in="${xspec.result.xml}"
out="${xspec.result.junit}"
style="${xspec.junit.reporter.xsl}" />
</target>
<!-- Main target -->
<target name="xspec"
description="Generates the result of XSpec tests"
depends="report-html, report-coverage, report-junit, fail, cleanup" />
<!-- Makes the build fail, unless otherwise specified -->
<target name="fail" if="${xspec.fail}">
<xml-to-properties in="${xspec.result.xml}" style="find-test-failure.xsl" />
<fail message="XSpec tests failed. See ${xspec.result.html} for a report.">
<condition>
<not>
<istrue value="${xspec.passed}" />
</not>
</condition>
</fail>
</target>
<!-- Cleans up the output files, if required-->
<target name="cleanup" if="${clean.output.dir}">
<echo message="Clean up"
level="info" />
<!-- Need to retry, for someone may still hold a file, which tends to happen on AppVeyor. -->
<retry retrycount="1" retrydelay="1000">
<delete dir="${xspec.output.dir}" />
</retry>
</target>
</project>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
<!-- Copyright (c) 2008, 2010 Jeni Tennison -->
<!-- -->
<!-- The contents of this file are subject to the MIT License (see the URI -->
<!-- http://www.opensource.org/licenses/mit-license.php for details). -->
<!-- -->
<!-- Permission is hereby granted, free of charge, to any person obtaining -->
<!-- a copy of this software and associated documentation files (the -->
<!-- "Software"), to deal in the Software without restriction, including -->
<!-- without limitation the rights to use, copy, modify, merge, publish, -->
<!-- distribute, sublicense, and/or sell copies of the Software, and to -->
<!-- permit persons to whom the Software is furnished to do so, subject to -->
<!-- the following conditions: -->
<!-- -->
<!-- The above copyright notice and this permission notice shall be -->
<!-- included in all copies or substantial portions of the Software. -->
<!-- -->
<!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
<!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.-->
<!-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -->
<!-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -->
<!-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -->
<!-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->