File: build.xml

package info (click to toggle)
xom 1.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 18,056 kB
  • sloc: xml: 93,339; java: 47,828; makefile: 26; sh: 11
file content (698 lines) | stat: -rw-r--r-- 28,492 bytes parent folder | download | duplicates (2)
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
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
<?xml version="1.0"?>
<!-- Copyright 2002-2007, 2009 Elliotte Rusty Harold

This library is free software; you can redistribute 
it and/or modify it under the terms of version 2.1 of 
the GNU Lesser General Public License as published by  
the Free Software Foundation.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General 
Public License along with this library; if not, write to the 
Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
Boston, MA  02111-1307  USA

You can contact Elliotte Rusty Harold by sending e-mail to
elharo@metalab.unc.edu. Please include the word "XOM" in the
subject line. The XOM home page is http://www.xom.nu/
-->
<project name="XOM" default="help" basedir=".">

    <description>
      Build XOM
    </description>
   
  <!-- set global properties for this build -->
  <target name="init">
    <tstamp/>
    <property name="Name"    value="XOM"/>
    <property name="name"    value="xom"/>
    <property name="version" value="1.2.1"/>
    <property name="year"    value="2009"/>

    <echo message="----------- ${Name} ${version} ------------"/>

    <property name="debug"       value="on"/>
    <property name="optimize"    value="off"/>
    <property name="deprecation" value="off"/>

    <property name="src.dir"    value="./src"/>
    <property name="fat.src"    value="./fatsrc"/>
    <property name="src15.dir"  value="./src15"/>
    <property name="lib.dir"    value="./lib"/>
    <property name="lib2.dir"   value="./lib2"/>
    <property name="packages"   value="nu.xom.*"/>

    <property name="build.dir"       value="./build"/>
    <property name="build15.dir"     value="./classes15"/>
    <property name="build.src"       value="./build/src"/>
    <property name="build.dest"      value="./build/classes"/>
    <property name="build.javadocs"  value="./build/apidocs"/>
    <property name="testoutput.dir"  value="./testresults"/>
    <property name="dist.dir"        value="./dist"/>    
    <property name="clover.dir"      value="./clover"/>
    <property name="testreports.dir" value="./testreports" />

    <property name="xml-apis.jar"   value="${lib.dir}/xml-apis.jar"/>
    <property name="parser.jar"     value="${lib.dir}/dtd-xercesImpl.jar"/>
    <property name="xslt.jar"       value="${lib.dir}/xalan.jar"/>
    <property name="serializer.jar" value="${lib.dir}/serializer.jar"/>
    <property name="tagsoup.jar"    value="${lib2.dir}/tagsoup-1.2.jar"/>
    <property name="junit.jar"      value="${lib.dir}/junit.jar"/>
    <property name="xom.jar"        value="${build.dir}/${name}-${version}.jar"/>
    <property name="xom-core"       value="${build.dest}"/>
    
    <property name="saxon6.jar"     value="${lib2.dir}/saxon.jar"/>
    <property name="saxon7.jar"     value="${lib2.dir}/saxon-aelfred.jar"/>
    <property name="gnujaxp.jar"    value="${lib2.dir}/gnujaxp.jar"/>
    <property name="resolver.jar"   value="${lib2.dir}/resolver.jar"/>
    <property name="dom4j.jar"      value="${lib2.dir}/dom4j-1.5.1.jar"/>

    <property name="excludes"       value=".clover, .DS_Store, **/.DS_Store, **/*.zip, **/.thumbnails/**, clover_html/**, clover/**, xom.gif, data/XInclude-Test-Suite/**, data/xmlconf/**, data/canonical/xmlconf/**, data/oasis*/**, **/testresults/**, **/pantry/**, **/workspace/**, **/junit*properties, **/.nautilus-metafile.xml, website/**, **/.project, **/.classpath, build/**, dist/**, .settings/**, lib2/**, xom.fb, jester*, trademark*"/>

    <property name="test.outputFormat" value="xml"/>   
    
    <!-- only needed for servlet samples -->
    <property name="servlet.jar"    value="${lib2.dir}/servlet.jar"/>
    <condition property="servlet.jar.installed">
      <and>
        <available classname="javax.servlet.ServletException" classpath="${servlet.jar}" />
        <available classname="javax.servlet.SingleThreadModel" classpath="${servlet.jar}" />
        <available classname="javax.servlet.http.HttpServletRequest" classpath="${servlet.jar}" />
        <available classname="javax.servlet.http.HttpServletResponse" classpath="${servlet.jar}"/> 
        <available classname="javax.servlet.http.HttpServlet" classpath="${servlet.jar}" />
      </and>
    </condition> 
    
    <path id="compile.class.path">
      <pathelement location="${xml-apis.jar}"/>
      <pathelement location="${parser.jar}"/>
      <pathelement location="${junit.jar}"/>
      <pathelement location="${servlet.jar}"/>
    </path>

    <path id="run.class.path">
      <pathelement location="${xml-apis.jar}"/>
      <pathelement location="${parser.jar}"/>
      <pathelement location="${xom-core}"/>
      <pathelement location="${xslt.jar}"/>
      <pathelement location="${serializer.jar}"/>
    </path>
    
    <path id="test.class.path">
      <path refid="run.class.path"/>
      <pathelement location="${junit.jar}"/>
      <pathelement location="${saxon6.jar}"/>
      <pathelement location="${saxon7.jar}"/>
      <pathelement location="${gnujaxp.jar}"/>
      <pathelement location="${resolver.jar}"/>
      <pathelement location="${dom4j.jar}"/>
    </path>
    
    <path id="doc.class.path">
      <path refid="test.class.path"/>
      <pathelement location="${build.dest}"/>
      <pathelement location="${tagsoup.jar}"/>
    </path>

    <!-- set these properties for debugging -->
    <property name="compile.classpath" refid="compile.class.path"/>
    <property name="test.classpath" refid="test.class.path"/>
    <property name="run.classpath" refid="run.class.path"/>
    <property name="doc.classpath" refid="doc.class.path"/>


    <available property="tagsoup.installed" classname="org.ccil.cowan.tagsoup.Parser">
      <classpath>
        <pathelement location="${tagsoup.jar}" />
      </classpath>
    </available>
    
    <available property="clover.installed" 
               file="clover.jar" filepath="${ant-home}/lib/clover.jar" />
    
  </target>
  
  <target name="help">
    <echo>
XOM Build file
-------------------------------------------------------------
    
  available targets are:
    
    help      --> print this message
    jar       --> build the xom.jar file
    samples   --> build the xom-samples.jar file
    compile   --> compile the source code
    compile15 --> compile the classes that depend on Java 1.5
    javadoc   --> generate the API documentation
    betterdoc --> better formatted API documentation (requires Ant 1.6)
    test      --> run JUnit test suite
    testui    --> run Junit test suite in GUI 
    clean     --> clean up the build directory
    dist      --> the zip and .tar.gz files
    
  Use the option -Dfat=true to make Text objects bigger but faster.

-------------------------------------------------------------
    </echo>
  </target>

  <target name="prepare" depends="init, prepare-dirs, prepare-fat" />
  
  <target name="prepare-dirs" depends="init">
    <mkdir dir="${dist.dir}"/>
    <mkdir dir="${testoutput.dir}"/>
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build15.dir}"/>
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.dest}"/>

    <delete file="${build.src}/nu/xom/Text.java" failonerror="false"/>

    <copy todir="${build.src}">
      <fileset dir="${src.dir}"/>
    </copy>
    
  </target>

  <!-- use Text.java that stores contents in String -->
  <target name="prepare-fat" depends="init" if="fat">
	 <copy todir="${build.src}" overwrite="true">
	    <fileset dir="${fat.src}"/>
	 </copy>
  </target>


  <target name="compile-core" depends="prepare, compile15"
          description="Compile the source code">
    <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}"
           deprecation="${deprecation}"
           target="1.2"
           source="1.3"
           encoding="UTF-8"
    	   fork="true"
           excludes="nu/xom/pantry/* nu/xom/tools/* nu/xom/samples/*Servlet.java">
       <classpath refid="compile.class.path"/>
    </javac>
    <copy file="${build.src}/nu/xom/characters.dat" tofile="${build.dest}/nu/xom/characters.dat"/>

    <copy file="${build.src}/nu/xom/compositions.dat" tofile="${build.dest}/nu/xom/compositions.dat" />

    <!-- This file requires Java 1.5 to generate so we compile it with a 
         different target and copy it over here. -->
    <copy file="classes15/nu/xom/JDK15XML1_0Parser.class" tofile="${build.dest}/nu/xom/JDK15XML1_0Parser.class"/>
  </target>


  <target name="compile" depends="compile-core, compile-servlets" 
          description="Compile the source code" />
  
  <target name="compile-servlets" depends="compile-core" if="servlet.jar.installed"
          description="Compile the source code including the servlet samples">
    <javac srcdir="${build.src}"
           sourcepath=""
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}"
           deprecation="${deprecation}"
           target="1.2"
           source="1.3"
           encoding="UTF-8">
       <classpath refid="compile.class.path"/>
       <include name="nu/xom/samples/*Servlet.java" />
    </javac>
  </target>

  
  <!-- This task requires Java 1.5 to complete successfully -->
  <target name="compile15" depends="prepare" description="Compile the JDK15XML1_0Parser" >
    <javac srcdir="${src15.dir}"
           destdir="${build15.dir}"
           debug="${debug}"
           optimize="${optimize}"
           deprecation="${deprecation}"
           target="1.2"
           source="1.3"
           encoding="UTF-8"
           failonerror="false">
       <classpath refid="compile.class.path"/>
    </javac>
  </target>

  <target name="minimal" depends="compile" description="Create xom-minimal.jar">
    <jar jarfile="${build.dir}/${name}-${version}-minimal.jar"
         basedir="${build.dest}"
         index="no"
		 compress="yes"
         includes="nu/xom/* nu/xom/xslt/* nu/xom/xinclude/* nu/xom/converters/* nu/xom/canonical/* nu/xom/tests/XOMTestCase.class"
         excludes="nu/xom/samples/* nu/xom/benchmarks/* nu/xom/pantry/* nu/xom/tools/*">
      <manifest>
        <attribute name="Sealed" value="true"/>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Specification-Title"    value="XOM"/>
        <attribute name="Specification-Version"  value="${version}"/>
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
        <attribute name="Implementation-Title"   value="XOM"/>
        <attribute name="Implementation-Version" value="${version}"/>
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
        <attribute name="Main-Class" value="nu.xom.Info"/>
        <section name="nu/xom/">
          <attribute name="Specification-Title"   value="XOM core classes"/>
          <attribute name="Implementation-Title"  value="nu.xom"/>
        </section>
        <section name="nu/xom/xslt/">
          <attribute name="Specification-Title"   value="XOM XSLT interface"/>
          <attribute name="Implementation-Title"  value="nu.xom.xslt"/>
        </section>
        <section name="nu/xom/xinclude/">
          <attribute name="Specification-Title"   value="XOM XInclude engine"/>
          <attribute name="Implementation-Title"  value="nu.xom.xinclude"/>
        </section>
        <section name="nu/xom/converters/">
          <attribute name="Specification-Title"   value="XOM converters to other object models"/>
          <attribute name="Implementation-Title"  value="nu.xom.converters"/>
        </section>
        <section name="nu/xom/canonical/">
          <attribute name="Specification-Title"   value="XOM Canonical XML support"/>
          <attribute name="Implementation-Title"  value="nu.xom.canonical"/>
        </section>
      </manifest>
    </jar>
  </target>


  <target name="jar" depends="compile" description="Create xom.jar">
    <jar jarfile="${build.dir}/${name}-${version}.jar"
         basedir="${build.dest}"
         index="no"
		 compress="yes"
         includes="nu/xom/* nu/xom/xslt/* nu/xom/xinclude/* nu/xom/converters/* nu/xom/canonical/* nu/xom/tests/XOMTestCase.class"
         excludes="nu/xom/samples/* nu/xom/benchmarks/* nu/xom/pantry/* nu/xom/tools/*">

      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Specification-Title"    value="XOM"/>
        <attribute name="Specification-Version"  value="${version}"/>
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
        <attribute name="Implementation-Title"   value="XOM"/>
        <attribute name="Implementation-Version" value="${version}"/>
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
        <attribute name="Main-Class" value="nu.xom.Info"/>
        <section name="nu/xom/">
          <attribute name="Sealed" value="true"/>
          <attribute name="Specification-Title"   value="XOM core classes"/>
          <attribute name="Implementation-Title"  value="nu.xom"/>
        <attribute name="Implementation-Version"  value="${version}"/>
        <attribute name="Implementation-Vendor"   value="Elliotte Rusty Harold"/>          
       </section>
        <section name="nu/xom/xslt/">
          <attribute name="Sealed" value="true"/>
          <attribute name="Specification-Title"   value="XOM XSLT interface"/>
          <attribute name="Implementation-Title"  value="nu.xom.xslt"/>
        </section>
        <section name="nu/xom/xinclude/">
          <attribute name="Sealed" value="true"/>
          <attribute name="Specification-Title"   value="XOM XInclude engine"/>
          <attribute name="Implementation-Title"  value="nu.xom.xinclude"/>
        </section>
        <section name="nu/xom/converters/">
          <attribute name="Sealed" value="true"/>
          <attribute name="Specification-Title"   value="XOM converters to other object models"/>
          <attribute name="Implementation-Title"  value="nu.xom.converters"/>
        </section>
        <section name="nu/xom/canonical/">
          <attribute name="Sealed" value="true"/>
          <attribute name="Specification-Title"   value="XOM Canonical XML support"/>
          <attribute name="Implementation-Title"  value="nu.xom.canonical"/>
        </section>
      </manifest>
    </jar>
  </target>

  
  <target name="samples" depends="compile" description="Create xom-samples.jar">
    <jar jarfile="${build.dir}/${name}-samples.jar"
         basedir="${build.dest}"
         index="yes"
		 compress="yes"
         includes="nu/xom/samples/* nu/xom/benchmarks/*"
         excludes="nu/xom/xslt/* nu/xom/xinclude/* nu/xom/tools/* nu/xom/converters/* nu/xom/canonical/* nu/xom/pantry/*">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Specification-Title"    value="XOM Samples"/>
        <attribute name="Specification-Version"  value="${version}"/>
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
        <attribute name="Implementation-Title"   value="XOM Samples"/>
        <attribute name="Implementation-Version" value="${version}"/>
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
<!-- I can't get this to work yet
        <attribute name="Main-Class" value="nu.xom.samples.XMLPrinter"/>
        <attribute name="Class-Path" value="${name}-${version}.jar"/> -->
      </manifest>
    </jar>
  </target>

  
  <target name="javadoc" depends="prepare"
          description="Generate the API documentation">
          
    <mkdir dir="${build.javadocs}"/>
    
    <javadoc packagenames="nu.xom.xslt, nu.xom.canonical, nu.xom.xinclude, nu.xom, nu.xom.converters"
             sourcepath="${build.src}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             overview="overview.html"
             use="true"
             splitindex="true"
             noindex="false"
             windowtitle="${Name} ${version}  API"
             docencoding="UTF-8"
             charset="UTF-8"
             doctitle="${Name} ${version}"
             bottom="Copyright 2002-${year} &lt;a href='http://www.elharo.com/'&gt;Elliotte Rusty Harold&lt;/a&gt;
			 &lt;br /&gt; &lt;a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;elharo%40metalab%2Eunc%2Eedu?Subject=XOM'&gt;elharo&#64;metalab&#46;unc&#46;edu&lt;/a&gt;">
      <classpath refid="test.class.path"/>
      
    <fileset dir="${build.src}" defaultexcludes="yes">
      <include name="nu/xom/tests/XOMTestCase.java" />
    </fileset>
      
    </javadoc>
  </target>
  
  
  <!-- I can never remember the exact target name -->
  <target name="javadocs"   depends="javadoc" />
  <target name="apidocs"    depends="javadoc"/>
  <target name="apidoc"     depends="javadoc"/>
  <target name="betterdocs" depends="betterdoc"/>

  <target name="-checkForTagSoup" unless="tagsoup.installed">
    <echo>
    Better documentation requires TagSoup to be installed 
    in the lib2 directory. You can download it from
    http://mercury.ccil.org/~cowan/XML/tagsoup/
    </echo>
  </target>

  <target name="-checkForClover" unless="clover.installed">
    <echo>
    The task you are trying to run requires Clover to be installed 
    in the $ANT_HOME/lib directory. You can purchase Clover from
    http://www.cenqua.com/clover/
    </echo>
  </target>

  <!-- This task requires Ant 1.6 and TagSoup -->
  <target name="betterdoc" depends="compile, -checkForTagSoup" if="tagsoup.installed"
          description="Generate the API documentation">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="nu.xom.xslt, nu.xom.canonical, nu.xom.xinclude, nu.xom, nu.xom.converters"
             sourcepath="${build.src}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             overview="overview.html"
             use="true"
             splitindex="true"
             noindex="false"
             windowtitle="${Name} ${version}  API"
             docencoding="UTF-8"
             charset="UTF-8"
             noqualifier="java.lang:java.io"
             link="http://www.junit.org/junit/javadoc/3.8.1"
             doctitle="${Name} ${version}"
             bottom="Copyright 2002-${year} &lt;a href='http://www.elharo.com/'&gt;Elliotte Rusty Harold&lt;/a&gt;
			 &lt;br/&gt; &lt;a href='mailto:elharo@metalab.unc.edu?Subject=XOM'&gt;elharo@metalab.unc.edu&lt;/a&gt;">
      <classpath refid="test.class.path"/>
      
    <fileset dir="${build.src}" defaultexcludes="yes">
      <include name="nu/xom/tests/XOMTestCase.java" />
    </fileset>
    </javadoc>
    
    <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}"
           deprecation="${deprecation}"
           target="1.2"
           source="1.3"
           encoding="UTF-8"
           includes="nu/xom/tools/*">
      <classpath>
        <pathelement path="${compile.class.path}"/>
        <pathelement path="${tagsoup.jar}"/> 
      </classpath>
    </javac>
    
    <java classname="nu.xom.tools.XHTMLJavaDoc" fork="yes"> 
      <jvmarg value="-Xbootclasspath/p:lib/dtd-xercesImpl.jar:lib/xml-apis.jar:lib/xalan.jar"/> 
      <classpath refid="doc.class.path" />
      <arg value="build/apidocs"/> 
    </java>
  </target>

  
  <target name="dist" depends="zip, tar.gz, maven" />
 
  <target name="zip" depends="jar, betterdoc, samples" 
          description="Build zip file for distro">

    <zip destfile="${dist.dir}/${name}-${version}-src.zip">
      <zipfileset prefix="XOM" dir="." excludes="${excludes}"/> 
    </zip>

    <zip destfile="${dist.dir}/${name}-${version}.zip">
      <zipfileset prefix="XOM" dir="." excludes="${excludes}"/>   
      <zipfileset prefix="XOM/apidocs" dir="./${build.dir}/apidocs" 
        excludes="**/.thumbnails/**, **/.nautilus-metafile.xml, website/**, **/.project, **/.classpath, **/.DS_Store"/>   
      <zipfileset fullpath="XOM/${name}-${version}.jar" dir="./${build.dir}" includes="${name}-${version}.jar"/> 
      <zipfileset fullpath="XOM/${name}-samples.jar" dir="./${build.dir}" includes="${name}-samples.jar"/>
    </zip>

  </target>
  
  
  <target name="tar" depends="jar, betterdoc, samples" 
          description="Build tar file for distro">

    <tar destfile="${dist.dir}/${name}-${version}-src.tar">
      <tarfileset prefix="XOM" dir="." 
        excludes="${excludes}"/> 
    </tar>

    <tar destfile="${dist.dir}/${name}-${version}.tar">
      <tarfileset prefix="XOM" dir="." 
        excludes="${excludes}"/>   
      <tarfileset prefix="XOM/apidocs" dir="./${build.dir}/apidocs" 
        excludes="**/.thumbnails/**, **/.nautilus-metafile.xml, website/**, **/.project, **/.classpath, **/.DS_Store"/>   
      <tarfileset fullpath="XOM/${name}-${version}.jar" dir="./${build.dir}" includes="${name}-${version}.jar"/> 
      <tarfileset fullpath="XOM/${name}-samples.jar" dir="./${build.dir}" includes="${name}-samples.jar"/>   
    </tar>

  </target>
  
  
  <target name="tar.gz" depends="tar" description="Build tar.gz file for distro">
     <gzip src="${dist.dir}/${name}-${version}.tar" zipfile="${dist.dir}/${name}-${version}.tar.gz"/>
     <gzip src="${dist.dir}/${name}-${version}-src.tar" zipfile="${dist.dir}/${name}-${version}-src.tar.gz"/>
  </target>

 
  <!-- This task requires the ANT optional.jar -->
  <target name="test" depends="compile" description="Run JUnit tests using command line user interface">

    <junit fork="yes">
       <classpath refid="test.class.path" />
       <formatter type="${test.outputFormat}" />
       <batchtest fork="yes" todir="${testoutput.dir}">
         <fileset dir="${build.src}">
           <include name="**/*Test.java" />
           <exclude name="**/pantry/*" />
           <exclude name="**/MegaTest.java" />
           <exclude name="**/benchmarks/*.java" />
           <exclude name="**/EBCDICTest.java" />
         </fileset>
      </batchtest>
    </junit>

    <junitreport todir="${testoutput.dir}">
      <fileset dir="${testoutput.dir}">
        <include name="TEST-*.xml" />
      </fileset>
      <report todir="${testoutput.dir}" />
    </junitreport>

  </target>
 
 
  <target name="testjar" depends="jar" description="Run JUnit tests using jar file">
    <junit printsummary="on" fork="no">
       <classpath>
          <pathelement location="${xom.jar}"/>
       </classpath>
       <classpath refid="run.class.path" />
       <formatter type="${test.outputFormat}" />
       <batchtest fork="yes" todir="${testoutput.dir}">
         <fileset dir="${build.src}">
           <include name="**/*Test.java" />
           <exclude name="**/pantry/*" />
           <exclude name="**/MegaTest.java" />
           <exclude name="**/benchmarks/*.java" />
           <exclude name="**/EBCDICTest.java" />
         </fileset>
      </batchtest>
    </junit>
  </target>
 

  <target name="testui" depends="compile" description="Run JUnit tests using GUI interface">
    <java classname="junit.swingui.TestRunner" fork="yes" maxmemory="99m">
      <sysproperty key="org.xml.sax.driver" value="org.apache.xerces.parsers.SAXParser"/> 
      <classpath refid="test.class.path" />
      <arg value="nu.xom.tests.XOMTests"/> 
    </java>
  </target>
  
    
  <target name="clean" depends="init" description="Remove build files">
    <delete dir="${build.dir}"/>
    <delete dir="${testoutput.dir}"/>
    <delete dir=".clover"/>
    <delete dir="clover"/>
    <delete dir="clover_html"/>
    <delete>
      <fileset dir="." includes="junit*properties"/>
    </delete>
    <delete dir="${dist.dir}"/>
  </target>

  
  <!-- These tasks require Clover -->
  <taskdef resource="clovertasks"/>
  
  <target name="with.clover" depends="init, -checkForClover">
    <mkdir dir="${clover.dir}"/>
    <clover-setup initString="${clover.dir}/xom_coverage.db">
       <files>
           <include name="nu/xom/**"/> <!-- work around Ant 1.6.3 bug  #34722 -->
	       <exclude name="nu/xom/UnicodeUtil.java"/>
	       <exclude name="nu/xom/Latin6Writer.java"/>
	       <exclude name="nu/xom/Latin8Writer.java"/>
	       <exclude name="nu/xom/Latin10Writer.java"/>
	       <exclude name="nu/xom/tests/FastTests.java"/>
	       <exclude name="nu/xom/tests/XOMTests.java"/>
	       <exclude name="nu/xom/samples/**"/>
	       <exclude name="nu/xom/pantry/**"/>
	       <exclude name="nu/xom/benchmarks/**"/>
           <exclude name="nu/xom/tools/**" />
       </files>
    </clover-setup>
  </target>

  
  <property name="ant-home" value="/opt/ant"/>

  <target name="clover.html" depends="with.clover">
    <clover-report>
       <current outfile="clover_html" title="Clover results for ${Name} ${version}">
	     <format type="html"/>
       </current>	 
    </clover-report>
  </target>
  
 
  <!-- This task requires the ANT optional.jar. clover.jar, and junit.jar to be installed in ANT_HOME/lib -->
  <target name="clovertest" depends="compile, -checkForClover" description="Run JUnit tests with clover.jar in classpath">
    <junit printsummary="on" fork="no">
       <classpath refid="test.class.path" />
        <classpath>
          <pathelement path="${ant-home}/lib/clover.jar"/>
        </classpath>
        <formatter type="${test.outputFormat}" />
       <batchtest fork="yes" todir="${testoutput.dir}">
         <fileset dir="${build.src}">
           <include name="**/*Test.java" />
           <exclude name="**/pantry/*.java" />
           <exclude name="**/MegaTest.java" />
           <exclude name="**/benchmarks/*.java" />
           <exclude name="**/tools/*.java" />
           <exclude name="**/EBCDICTest.java" />
	       <exclude name="nu/xom/tests/FastTests.java"/>
	       <exclude name="nu/xom/tests/XOMTests.java"/>
         </fileset>
      </batchtest>
    </junit>
  </target> 

  <!-- This task requires the ANT optional.jar. clover.jar, and junit.jar to be installed in ANT_HOME/lib -->
  <target name="fastclover" depends="compile, -checkForClover" description="Run JUnit tests with clover.jar in classpath">
    <junit printsummary="on" fork="no">
       <classpath refid="test.class.path" />
        <classpath>
          <pathelement path="${ant-home}/lib/clover.jar"/>
        </classpath>
        <formatter type="${test.outputFormat}" />
       <batchtest fork="yes" todir="${testoutput.dir}">
         <fileset dir="${build.src}">
           <include name="**/*Test.java" />
           <exclude name="**/pantry/*.java" />
           <exclude name="**/EncodingTest.java" />
           <exclude name="**/XIncludeTest.java" />
           <exclude name="**/MegaTest.java" />
           <exclude name="**/benchmarks/*.java" />
           <exclude name="**/tools/*.java" />
           <exclude name="**/EBCDICTest.java" />
	       <exclude name="nu/xom/tests/FastTests.java"/>
	       <exclude name="nu/xom/tests/XOMTests.java"/>
         </fileset>
      </batchtest>
    </junit>
  </target> 

<!-- Generate a Maven JAR for uploading to the maven
    bug repository and hence placement onto ibiblio and mirrors. 
    See http://maven.apache.org/repository-upload.html -->
  <target name="maven" depends="jar" >
    <property name="pom.template" location="project.xml" />
    <property name="pom.file" location="${build.dir}/project.xml" />
    <property name="package.jar"
location="${build.dir}/${name}-${version}.jar"/>
    <property name="license" location="LICENSE.txt" />
    <property name="xom-maven.jar"
location="${dist.dir}/xom-maven-${version}.jar" />
    <copy file="${pom.template}" tofile="${pom.file}">
      <filterset>
       <filter token="VERSION" value="${version}"/>
     </filterset>
    </copy>
    <jar destFile="${xom-maven.jar}">
      <fileset file="${pom.file}" />
      <fileset file="${license}" />
      <fileset file="${package.jar}" />
    </jar>
  </target>

  <target name="debug" depends="init" description="Print various Ant properties">
    <echoproperties/>
    <java classname="org.apache.xalan.Version" fork="yes">
      <classpath refid="test.class.path" />
    </java>
  </target>
  
  <target name="website" depends="init" description="Print various Ant properties">
    <ant antfile="build.xml" dir="website"/>
  </target>
  
</project>