~ubuntu-branches/ubuntu/precise/xom/precise

« back to all changes in this revision

Viewing changes to build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2007-11-25 15:50:40 UTC
  • Revision ID: james.westby@ubuntu.com-20071125155040-r75ikcqf1vu0cei7
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!-- Copyright 2002-2005 Elliotte Rusty Harold
 
3
 
 
4
This library is free software; you can redistribute 
 
5
it and/or modify it under the terms of version 2.1 of 
 
6
the GNU Lesser General Public License as published by  
 
7
the Free Software Foundation.
 
8
 
 
9
This library is distributed in the hope that it will be useful,
 
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
12
GNU Lesser General Public License for more details.
 
13
 
 
14
You should have received a copy of the GNU Lesser General 
 
15
Public License along with this library; if not, write to the 
 
16
Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
 
17
Boston, MA  02111-1307  USA
 
18
 
 
19
You can contact Elliotte Rusty Harold by sending e-mail to
 
20
elharo@metalab.unc.edu. Please include the word "XOM" in the
 
21
subject line. The XOM home page is http://www.xom.nu/
 
22
-->
 
23
<project name="XOM" default="help" basedir=".">
 
24
 
 
25
    <description>
 
26
      Build XOM
 
27
    </description>
 
28
   
 
29
  <!-- set global properties for this build -->
 
30
  <target name="init">
 
31
    <tstamp/>
 
32
    <property name="Name"    value="XOM"/>
 
33
    <property name="name"    value="xom"/>
 
34
    <property name="version" value="1.1"/>
 
35
    <property name="year"    value="2005"/>
 
36
 
 
37
    <echo message="----------- ${Name} ${version} ------------"/>
 
38
 
 
39
    <property name="debug"       value="on"/>
 
40
    <property name="optimize"    value="off"/>
 
41
    <property name="deprecation" value="off"/>
 
42
 
 
43
    <property name="src.dir"    value="./src"/>
 
44
    <property name="fat.src"    value="./fatsrc"/>
 
45
    <property name="src15.dir"  value="./src15"/>
 
46
    <property name="lib.dir"    value="./lib"/>
 
47
    <property name="lib2.dir"   value="./lib2"/>
 
48
    <property name="packages"   value="nu.xom.*"/>
 
49
 
 
50
    <property name="build.dir"       value="./build"/>
 
51
    <property name="build15.dir"     value="./classes15"/>
 
52
    <property name="build.src"       value="./build/src"/>
 
53
    <property name="build.dest"      value="./build/classes"/>
 
54
    <property name="build.javadocs"  value="./build/apidocs"/>
 
55
    <property name="testoutput.dir"  value="./testresults"/>
 
56
    <property name="dist.dir"        value="./dist"/>    
 
57
    <property name="clover.dir"      value="./clover"/>
 
58
    <property name="testreports.dir" value="./testreports" />
 
59
    <property name="jaxen.dir"       value="${build.dir}/jaxen-classes"/>
 
60
 
 
61
    <property name="xml-apis.jar"   value="${lib.dir}/xml-apis.jar"/>
 
62
    <property name="parser.jar"     value="${lib.dir}/xercesImpl.jar"/>
 
63
    <property name="xslt.jar"       value="${lib.dir}/xalan.jar"/>
 
64
    <property name="serializer.jar" value="${lib.dir}/serializer.jar"/>
 
65
    <property name="tagsoup.jar"    value="${lib2.dir}/tagsoup-1.0rc3.jar"/>
 
66
    <property name="junit.jar"      value="${lib.dir}/junit.jar"/>
 
67
    <property name="xom.jar"        value="${build.dir}/${name}-${version}.jar"/>
 
68
    <property name="xom-core"       value="${build.dest}"/>
 
69
    
 
70
    <property name="saxon6.jar"     value="${lib2.dir}/saxon.jar"/>
 
71
    <property name="saxon7.jar"     value="${lib2.dir}/saxon-aelfred.jar"/>
 
72
    <property name="gnujaxp.jar"    value="${lib2.dir}/gnujaxp.jar"/>
 
73
    <property name="resolver.jar"   value="${lib2.dir}/resolver.jar"/>
 
74
    <property name="dom4j.jar"      value="${lib2.dir}/dom4j-1.5.1.jar"/>
 
75
 
 
76
    <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*"/>
 
77
 
 
78
    <property name="test.outputFormat" value="xml"/>   
 
79
    
 
80
    <!-- only needed for servlet samples -->
 
81
    <property name="servlet.jar"    value="${lib2.dir}/servlet.jar"/>
 
82
    <condition property="servlet.jar.installed">
 
83
      <and>
 
84
        <available classname="javax.servlet.ServletException" classpath="${servlet.jar}" />
 
85
        <available classname="javax.servlet.SingleThreadModel" classpath="${servlet.jar}" />
 
86
        <available classname="javax.servlet.http.HttpServletRequest" classpath="${servlet.jar}" />
 
87
        <available classname="javax.servlet.http.HttpServletResponse" classpath="${servlet.jar}"/> 
 
88
        <available classname="javax.servlet.http.HttpServlet" classpath="${servlet.jar}" />
 
89
      </and>
 
90
    </condition> 
 
91
    
 
92
    <path id="compile.class.path">
 
93
      <pathelement location="${xml-apis.jar}"/>
 
94
      <pathelement location="${parser.jar}"/>
 
95
      <pathelement location="${junit.jar}"/>
 
96
      <pathelement location="${jaxen.dir}"/>
 
97
      <pathelement location="${servlet.jar}"/>
 
98
    </path>
 
99
 
 
100
    <path id="run.class.path">
 
101
      <pathelement location="${xml-apis.jar}"/>
 
102
      <pathelement location="${parser.jar}"/>
 
103
      <pathelement location="${xom-core}"/>
 
104
      <pathelement location="${jaxen.dir}"/>
 
105
      <pathelement location="${xslt.jar}"/>
 
106
      <pathelement location="${serializer.jar}"/>
 
107
    </path>
 
108
    
 
109
    <path id="test.class.path">
 
110
      <path refid="run.class.path"/>
 
111
      <pathelement location="${junit.jar}"/>
 
112
      <pathelement location="${saxon6.jar}"/>
 
113
      <pathelement location="${saxon7.jar}"/>
 
114
      <pathelement location="${gnujaxp.jar}"/>
 
115
      <pathelement location="${resolver.jar}"/>
 
116
      <pathelement location="${dom4j.jar}"/>
 
117
    </path>
 
118
    
 
119
    <path id="doc.class.path">
 
120
      <path refid="test.class.path"/>
 
121
      <pathelement location="${build.dest}"/>
 
122
      <pathelement location="${tagsoup.jar}"/>
 
123
    </path>
 
124
 
 
125
    <!-- set these properties for debugging -->
 
126
    <property name="compile.classpath" refid="compile.class.path"/>
 
127
    <property name="test.classpath" refid="test.class.path"/>
 
128
    <property name="run.classpath" refid="run.class.path"/>
 
129
    <property name="doc.classpath" refid="doc.class.path"/>
 
130
 
 
131
 
 
132
    <available property="tagsoup.installed" classname="org.ccil.cowan.tagsoup.Parser">
 
133
      <classpath>
 
134
        <pathelement location="${tagsoup.jar}" />
 
135
      </classpath>
 
136
    </available>
 
137
    
 
138
    <available property="clover.installed" 
 
139
               file="clover.jar" filepath="${ant-home}/lib/clover.jar" />
 
140
    
 
141
  </target>
 
142
  
 
143
  <target name="help">
 
144
    <echo>
 
145
XOM Build file
 
146
-------------------------------------------------------------
 
147
    
 
148
  available targets are:
 
149
    
 
150
    help      --> print this message
 
151
    jar       --> build the xom.jar file
 
152
    samples   --> build the xom-samples.jar file
 
153
    compile   --> compile the source code
 
154
    compile15 --> compile the classes that depend on Java 1.5
 
155
    javadoc   --> generate the API documentation
 
156
    betterdoc --> better formatted API documentation (requires Ant 1.6)
 
157
    test      --> run JUnit test suite
 
158
    testui    --> run Junit test suite in GUI 
 
159
    clean     --> clean up the build directory
 
160
    dist      --> the zip and .tar.gz files
 
161
    
 
162
  Use the option -Dfat=true to make Text objects bigger but faster.
 
163
 
 
164
-------------------------------------------------------------
 
165
    </echo>
 
166
  </target>
 
167
 
 
168
  <target name="prepare" depends="init, prepare-dirs, prepare-fat" />
 
169
  
 
170
  <target name="prepare-dirs" depends="init">
 
171
    <mkdir dir="${dist.dir}"/>
 
172
    <mkdir dir="${testoutput.dir}"/>
 
173
    <mkdir dir="${build.dir}"/>
 
174
    <mkdir dir="${build.dir}/jaxen"/>
 
175
    <mkdir dir="${build.dir}/jaxen-classes"/>
 
176
    <mkdir dir="${build15.dir}"/>
 
177
    <mkdir dir="${build.src}"/>
 
178
    <mkdir dir="${build.dest}"/>
 
179
 
 
180
    <delete file="${build.src}/nu/xom/Text.java" failonerror="false"/>
 
181
 
 
182
    <copy todir="${build.src}">
 
183
      <fileset dir="${src.dir}"/>
 
184
    </copy>
 
185
    
 
186
  </target>
 
187
 
 
188
  <!-- use Text.java that stores contents in String -->
 
189
  <target name="prepare-fat" depends="init" if="fat">
 
190
         <copy todir="${build.src}" overwrite="true">
 
191
            <fileset dir="${fat.src}"/>
 
192
         </copy>
 
193
  </target>
 
194
 
 
195
 
 
196
  <target name="compile-core" depends="prepare, compile-jaxen" 
 
197
          description="Compile the source code">
 
198
    <javac srcdir="${build.src}"
 
199
           destdir="${build.dest}"
 
200
           debug="${debug}"
 
201
           optimize="${optimize}"
 
202
           deprecation="${deprecation}"
 
203
           target="1.2"
 
204
           source="1.3"
 
205
           encoding="UTF-8"
 
206
           excludes="nu/xom/pantry/* nu/xom/tools/* nu/xom/samples/*Servlet.java">
 
207
       <classpath refid="compile.class.path"/>
 
208
    </javac>
 
209
    <copy file="${build.src}/nu/xom/characters.dat" tofile="${build.dest}/nu/xom/characters.dat"/>
 
210
 
 
211
    <copy file="${build.src}/nu/xom/compositions.dat" tofile="${build.dest}/nu/xom/compositions.dat" />
 
212
 
 
213
    <!-- This file requires Java 1.5 to generate so we compile it with a 
 
214
         different target and copy it over here. -->
 
215
    <copy file="classes15/nu/xom/JDK15XML1_0Parser.class" tofile="${build.dest}/nu/xom/JDK15XML1_0Parser.class"/>
 
216
  </target>
 
217
 
 
218
 
 
219
  <target name="compile" depends="compile-core, compile-servlets" 
 
220
          description="Compile the source code" />
 
221
  
 
222
  <target name="compile-servlets" depends="compile-core" if="servlet.jar.installed"
 
223
          description="Compile the source code including the servlet samples">
 
224
    <javac srcdir="${build.src}"
 
225
           sourcepath=""
 
226
           destdir="${build.dest}"
 
227
           debug="${debug}"
 
228
           optimize="${optimize}"
 
229
           deprecation="${deprecation}"
 
230
           target="1.2"
 
231
           source="1.3"
 
232
           encoding="UTF-8">
 
233
       <classpath refid="compile.class.path"/>
 
234
       <include name="nu/xom/samples/*Servlet.java" />
 
235
    </javac>
 
236
  </target>
 
237
 
 
238
  
 
239
  <!-- This task requires Java 1.5 to complete successfully -->
 
240
  <target name="compile15" depends="prepare" description="Compile the JDK15XML1_0Parser" >
 
241
    <javac srcdir="${src15.dir}"
 
242
           destdir="${build15.dir}"
 
243
           debug="${debug}"
 
244
           optimize="${optimize}"
 
245
           deprecation="${deprecation}"
 
246
           target="1.2"
 
247
           source="1.3"
 
248
           encoding="UTF-8"
 
249
           failonerror="false">
 
250
       <classpath refid="compile.class.path"/>
 
251
    </javac>
 
252
  </target>
 
253
 
 
254
  <target name="minimal" depends="compile" description="Create xom-minimal.jar">
 
255
    <jar jarfile="${build.dir}/${name}-${version}-minimal.jar"
 
256
         basedir="${build.dest}"
 
257
         index="no"
 
258
                 compress="yes"
 
259
         includes="nu/xom/* nu/xom/xslt/* nu/xom/xinclude/* nu/xom/converters/* nu/xom/canonical/* nu/xom/tests/XOMTestCase.class"
 
260
         excludes="nu/xom/samples/* nu/xom/benchmarks/* nu/xom/pantry/* nu/xom/tools/*">
 
261
      <manifest>
 
262
        <attribute name="Sealed" value="true"/>
 
263
        <attribute name="Built-By" value="${user.name}"/>
 
264
        <attribute name="Specification-Title"    value="XOM"/>
 
265
        <attribute name="Specification-Version"  value="${version}"/>
 
266
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
 
267
        <attribute name="Implementation-Title"   value="XOM"/>
 
268
        <attribute name="Implementation-Version" value="${version}"/>
 
269
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
 
270
        <attribute name="Main-Class" value="nu.xom.Info"/>
 
271
        <section name="nu/xom/">
 
272
          <attribute name="Specification-Title"   value="XOM core classes"/>
 
273
          <attribute name="Implementation-Title"  value="nu.xom"/>
 
274
        </section>
 
275
        <section name="nu/xom/xslt/">
 
276
          <attribute name="Specification-Title"   value="XOM XSLT interface"/>
 
277
          <attribute name="Implementation-Title"  value="nu.xom.xslt"/>
 
278
        </section>
 
279
        <section name="nu/xom/xinclude/">
 
280
          <attribute name="Specification-Title"   value="XOM XInclude engine"/>
 
281
          <attribute name="Implementation-Title"  value="nu.xom.xinclude"/>
 
282
        </section>
 
283
        <section name="nu/xom/converters/">
 
284
          <attribute name="Specification-Title"   value="XOM converters to other object models"/>
 
285
          <attribute name="Implementation-Title"  value="nu.xom.converters"/>
 
286
        </section>
 
287
        <section name="nu/xom/canonical/">
 
288
          <attribute name="Specification-Title"   value="XOM Canonical XML support"/>
 
289
          <attribute name="Implementation-Title"  value="nu.xom.canonical"/>
 
290
        </section>
 
291
      </manifest>
 
292
    </jar>
 
293
  </target>
 
294
 
 
295
 
 
296
  <target name="jar" depends="compile" description="Create xom.jar">
 
297
    <jar jarfile="${build.dir}/${name}-${version}.jar"
 
298
         basedir="${build.dest}"
 
299
         index="no"
 
300
                 compress="yes"
 
301
         includes="nu/xom/* nu/xom/xslt/* nu/xom/xinclude/* nu/xom/converters/* nu/xom/canonical/* nu/xom/tests/XOMTestCase.class"
 
302
         excludes="nu/xom/samples/* nu/xom/benchmarks/* nu/xom/pantry/* nu/xom/tools/*">
 
303
 
 
304
    <fileset dir="${jaxen.dir}"
 
305
         excludes="**Demo.class **/package.html org/jaxen/xom/** org/jaxen/XPathTestBase.class org/jaxen/jdom/** org/jaxen/dom4j/** org/jaxen/javabean/** org/jaxen/dom/** org/jaxen/**Test.class org/jaxen/saxpath/base/**Test.class org/jaxen/saxpath/helpers/**Test.class org/jaxen/saxpath/helpers/**Test.class org/jaxen/pattern/** org/jaxen/saxpath/SAXPathParseException.class org/jaxen/pattern/PriorityTest.class">
 
306
    </fileset> 
 
307
 
 
308
      <manifest>
 
309
        <attribute name="Built-By" value="${user.name}"/>
 
310
        <attribute name="Specification-Title"    value="XOM"/>
 
311
        <attribute name="Specification-Version"  value="${version}"/>
 
312
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
 
313
        <attribute name="Implementation-Title"   value="XOM"/>
 
314
        <attribute name="Implementation-Version" value="${version}"/>
 
315
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
 
316
        <attribute name="Main-Class" value="nu.xom.Info"/>
 
317
        <section name="nu/xom/">
 
318
          <attribute name="Sealed" value="true"/>
 
319
          <attribute name="Specification-Title"   value="XOM core classes"/>
 
320
          <attribute name="Implementation-Title"  value="nu.xom"/>
 
321
        <attribute name="Implementation-Version" value="${version}"/>
 
322
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
 
323
       </section>
 
324
        <section name="org/jaxen/">
 
325
          <attribute name="Specification-Title"   value="Jaxen XPath engine"/>
 
326
          <attribute name="Implementation-Title"  value="org.jaxen"/>
 
327
          <attribute name="Implementation-Version" value="1.1d4"/>
 
328
          <attribute name="Implementation-Vendor"  value="CodeHaus"/>
 
329
        </section>
 
330
        <section name="nu/xom/xslt/">
 
331
          <attribute name="Sealed" value="true"/>
 
332
          <attribute name="Specification-Title"   value="XOM XSLT interface"/>
 
333
          <attribute name="Implementation-Title"  value="nu.xom.xslt"/>
 
334
        </section>
 
335
        <section name="nu/xom/xinclude/">
 
336
          <attribute name="Sealed" value="true"/>
 
337
          <attribute name="Specification-Title"   value="XOM XInclude engine"/>
 
338
          <attribute name="Implementation-Title"  value="nu.xom.xinclude"/>
 
339
        </section>
 
340
        <section name="nu/xom/converters/">
 
341
          <attribute name="Sealed" value="true"/>
 
342
          <attribute name="Specification-Title"   value="XOM converters to other object models"/>
 
343
          <attribute name="Implementation-Title"  value="nu.xom.converters"/>
 
344
        </section>
 
345
        <section name="nu/xom/canonical/">
 
346
          <attribute name="Sealed" value="true"/>
 
347
          <attribute name="Specification-Title"   value="XOM Canonical XML support"/>
 
348
          <attribute name="Implementation-Title"  value="nu.xom.canonical"/>
 
349
        </section>
 
350
      </manifest>
 
351
    </jar>
 
352
  </target>
 
353
 
 
354
  
 
355
  <target name="samples" depends="compile" description="Create xom-samples.jar">
 
356
    <jar jarfile="${build.dir}/${name}-samples.jar"
 
357
         basedir="${build.dest}"
 
358
         index="yes"
 
359
                 compress="yes"
 
360
         includes="nu/xom/samples/* nu/xom/benchmarks/*"
 
361
         excludes="nu/xom/xslt/* nu/xom/xinclude/* nu/xom/tools/* nu/xom/converters/* nu/xom/canonical/* nu/xom/pantry/*">
 
362
      <manifest>
 
363
        <attribute name="Built-By" value="${user.name}"/>
 
364
        <attribute name="Specification-Title"    value="XOM Samples"/>
 
365
        <attribute name="Specification-Version"  value="${version}"/>
 
366
        <attribute name="Specification-Vendor"   value="Elliotte Rusty Harold"/>
 
367
        <attribute name="Implementation-Title"   value="XOM Samples"/>
 
368
        <attribute name="Implementation-Version" value="${version}"/>
 
369
        <attribute name="Implementation-Vendor"  value="Elliotte Rusty Harold"/>          
 
370
<!-- I can't get this to work yet
 
371
        <attribute name="Main-Class" value="nu.xom.samples.XMLPrinter"/>
 
372
        <attribute name="Class-Path" value="${name}-${version}.jar"/> -->
 
373
      </manifest>
 
374
    </jar>
 
375
  </target>
 
376
 
 
377
  
 
378
  <target name="javadoc" depends="prepare"
 
379
          description="Generate the API documentation">
 
380
          
 
381
    <mkdir dir="${build.javadocs}"/>
 
382
    
 
383
    <javadoc packagenames="nu.xom.xslt, nu.xom.canonical, nu.xom.xinclude, nu.xom, nu.xom.converters"
 
384
             sourcepath="${build.src}"
 
385
             destdir="${build.javadocs}"
 
386
             author="true"
 
387
             version="true"
 
388
             overview="overview.html"
 
389
             use="true"
 
390
             splitindex="true"
 
391
             noindex="false"
 
392
             windowtitle="${Name} ${version}  API"
 
393
             docencoding="UTF-8"
 
394
             charset="UTF-8"
 
395
             link="http://www.junit.org/junit/javadoc/3.8.1"
 
396
             doctitle="${Name} ${version}"
 
397
             bottom="Copyright 2002-${year} &lt;a href='http://www.elharo.com/'&gt;Elliotte Rusty Harold&lt;/a&gt;
 
398
                         &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;">
 
399
      <classpath refid="test.class.path"/>
 
400
      
 
401
    <fileset dir="${build.src}" defaultexcludes="yes">
 
402
      <include name="nu/xom/tests/XOMTestCase.java" />
 
403
    </fileset>
 
404
      
 
405
    </javadoc>
 
406
  </target>
 
407
  
 
408
  
 
409
  <!-- I can never remember the exact target name -->
 
410
  <target name="javadocs"   depends="javadoc" />
 
411
  <target name="apidocs"    depends="javadoc"/>
 
412
  <target name="apidoc"     depends="javadoc"/>
 
413
  <target name="betterdocs" depends="betterdoc"/>
 
414
 
 
415
  <target name="-checkForTagSoup" unless="tagsoup.installed">
 
416
    <echo>
 
417
    Better documentation requires TagSoup to be installed 
 
418
    in the lib2 directory. You can download it from
 
419
    http://mercury.ccil.org/~cowan/XML/tagsoup/
 
420
    </echo>
 
421
  </target>
 
422
 
 
423
  <target name="-checkForClover" unless="clover.installed">
 
424
    <echo>
 
425
    The task you are trying to run requires Clover to be installed 
 
426
    in the $ANT_HOME/lib directory. You can purchase Clover from
 
427
    http://www.cenqua.com/clover/
 
428
    </echo>
 
429
  </target>
 
430
 
 
431
  <!-- This task requires Ant 1.6 and TagSoup -->
 
432
  <target name="betterdoc" depends="compile, -checkForTagSoup" if="tagsoup.installed"
 
433
          description="Generate the API documentation">
 
434
    <mkdir dir="${build.javadocs}"/>
 
435
    <javadoc packagenames="nu.xom.xslt, nu.xom.canonical, nu.xom.xinclude, nu.xom, nu.xom.converters"
 
436
             sourcepath="${build.src}"
 
437
             destdir="${build.javadocs}"
 
438
             author="true"
 
439
             version="true"
 
440
             overview="overview.html"
 
441
             use="true"
 
442
             splitindex="true"
 
443
             noindex="false"
 
444
             windowtitle="${Name} ${version}  API"
 
445
             docencoding="UTF-8"
 
446
             charset="UTF-8"
 
447
             noqualifier="java.lang:java.io"
 
448
             link="http://www.junit.org/junit/javadoc/3.8.1"
 
449
             doctitle="${Name} ${version}"
 
450
             bottom="Copyright 2002-${year} &lt;a href='http://www.elharo.com/'&gt;Elliotte Rusty Harold&lt;/a&gt;
 
451
                         &lt;br/&gt; &lt;a href='mailto:elharo@metalab.unc.edu?Subject=XOM'&gt;elharo@metalab.unc.edu&lt;/a&gt;">
 
452
      <classpath refid="test.class.path"/>
 
453
      
 
454
    <fileset dir="${build.src}" defaultexcludes="yes">
 
455
      <include name="nu/xom/tests/XOMTestCase.java" />
 
456
    </fileset>
 
457
    </javadoc>
 
458
    
 
459
    <javac srcdir="${build.src}"
 
460
           destdir="${build.dest}"
 
461
           debug="${debug}"
 
462
           optimize="${optimize}"
 
463
           deprecation="${deprecation}"
 
464
           target="1.2"
 
465
           source="1.3"
 
466
           encoding="UTF-8"
 
467
           includes="nu/xom/tools/*">
 
468
      <classpath>
 
469
        <pathelement path="${compile.class.path}"/>
 
470
        <pathelement path="${tagsoup.jar}"/> 
 
471
      </classpath>
 
472
    </javac>
 
473
    
 
474
    <java classname="nu.xom.tools.XHTMLJavaDoc" fork="yes"> 
 
475
      <jvmarg value="-Xbootclasspath/p:lib/xercesImpl.jar:lib/xml-apis.jar:lib/xalan.jar"/> 
 
476
      <classpath refid="doc.class.path" />
 
477
      <arg value="build/apidocs"/> 
 
478
    </java>
 
479
  </target>
 
480
 
 
481
  
 
482
  <target name="dist" depends="zip, tar.gz, maven" />
 
483
 
 
484
  <target name="zip" depends="jar, betterdoc, samples" 
 
485
          description="Build zip file for distro">
 
486
 
 
487
    <zip destfile="${dist.dir}/${name}-${version}-src.zip">
 
488
      <zipfileset prefix="XOM" dir="." excludes="${excludes}"/> 
 
489
    </zip>
 
490
 
 
491
    <zip destfile="${dist.dir}/${name}-${version}.zip">
 
492
      <zipfileset prefix="XOM" dir="." excludes="${excludes}"/>   
 
493
      <zipfileset prefix="XOM/apidocs" dir="./${build.dir}/apidocs" 
 
494
        excludes="**/.thumbnails/**, **/.nautilus-metafile.xml, website/**, **/.project, **/.classpath, **/.DS_Store"/>   
 
495
      <zipfileset fullpath="XOM/${name}-${version}.jar" dir="./${build.dir}" includes="${name}-${version}.jar"/> 
 
496
      <zipfileset fullpath="XOM/${name}-samples.jar" dir="./${build.dir}" includes="${name}-samples.jar"/>
 
497
    </zip>
 
498
 
 
499
  </target>
 
500
  
 
501
  
 
502
  <target name="tar" depends="jar, betterdoc, samples" 
 
503
          description="Build tar file for distro">
 
504
 
 
505
    <tar destfile="${dist.dir}/${name}-${version}-src.tar">
 
506
      <tarfileset prefix="XOM" dir="." 
 
507
        excludes="${excludes}"/> 
 
508
    </tar>
 
509
 
 
510
    <tar destfile="${dist.dir}/${name}-${version}.tar">
 
511
      <tarfileset prefix="XOM" dir="." 
 
512
        excludes="${excludes}"/>   
 
513
      <tarfileset prefix="XOM/apidocs" dir="./${build.dir}/apidocs" 
 
514
        excludes="**/.thumbnails/**, **/.nautilus-metafile.xml, website/**, **/.project, **/.classpath, **/.DS_Store"/>   
 
515
      <tarfileset fullpath="XOM/${name}-${version}.jar" dir="./${build.dir}" includes="${name}-${version}.jar"/> 
 
516
      <tarfileset fullpath="XOM/${name}-samples.jar" dir="./${build.dir}" includes="${name}-samples.jar"/>   
 
517
    </tar>
 
518
 
 
519
  </target>
 
520
  
 
521
  
 
522
  <target name="tar.gz" depends="tar" description="Build tar.gz file for distro">
 
523
     <gzip src="${dist.dir}/${name}-${version}.tar" zipfile="${dist.dir}/${name}-${version}.tar.gz"/>
 
524
     <gzip src="${dist.dir}/${name}-${version}-src.tar" zipfile="${dist.dir}/${name}-${version}-src.tar.gz"/>
 
525
  </target>
 
526
 
 
527
 
 
528
  <!-- This task requires the ANT optional.jar -->
 
529
  <target name="test" depends="compile" description="Run JUnit tests using command line user interface">
 
530
 
 
531
    <junit printsummary="off" fork="yes">
 
532
       <classpath refid="test.class.path" />
 
533
       <formatter type="${test.outputFormat}" />
 
534
       <batchtest fork="yes" todir="${testoutput.dir}">
 
535
         <fileset dir="${build.src}">
 
536
           <include name="**/*Test.java" />
 
537
           <exclude name="**/pantry/*" />
 
538
           <exclude name="**/MegaTest.java" />
 
539
           <exclude name="**/benchmarks/*.java" />
 
540
           <exclude name="**/EBCDICTest.java" />
 
541
         </fileset>
 
542
      </batchtest>
 
543
    </junit>
 
544
 
 
545
    <junitreport todir="${testoutput.dir}">
 
546
      <fileset dir="${testoutput.dir}">
 
547
        <include name="TEST-*.xml" />
 
548
      </fileset>
 
549
      <report todir="${testoutput.dir}" />
 
550
    </junitreport>
 
551
 
 
552
  </target>
 
553
 
 
554
 
 
555
  <target name="testjar" depends="jar" description="Run JUnit tests using jar file">
 
556
    <junit printsummary="on" fork="no">
 
557
       <classpath>
 
558
          <pathelement location="${xom.jar}"/>
 
559
       </classpath>
 
560
       <classpath refid="run.class.path" />
 
561
       <formatter type="${test.outputFormat}" />
 
562
       <batchtest fork="yes" todir="${testoutput.dir}">
 
563
         <fileset dir="${build.src}">
 
564
           <include name="**/*Test.java" />
 
565
           <exclude name="**/pantry/*" />
 
566
           <exclude name="**/MegaTest.java" />
 
567
           <exclude name="**/benchmarks/*.java" />
 
568
           <exclude name="**/EBCDICTest.java" />
 
569
         </fileset>
 
570
      </batchtest>
 
571
    </junit>
 
572
  </target>
 
573
 
 
574
 
 
575
  <target name="testui" depends="compile" description="Run JUnit tests using GUI interface">
 
576
    <java classname="junit.swingui.TestRunner" fork="yes" maxmemory="99m">
 
577
      <sysproperty key="org.xml.sax.driver" value="org.apache.xerces.parsers.SAXParser"/> 
 
578
      <classpath refid="test.class.path" />
 
579
      <arg value="nu.xom.tests.XOMTests"/> 
 
580
    </java>
 
581
  </target>
 
582
  
 
583
    
 
584
  <target name="clean" depends="init" description="Remove build files">
 
585
    <delete dir="${build.dir}"/>
 
586
    <delete dir="${testoutput.dir}"/>
 
587
    <delete dir=".clover"/>
 
588
    <delete dir="clover"/>
 
589
    <delete dir="clover_html"/>
 
590
    <delete>
 
591
      <fileset dir="." includes="junit*properties"/>
 
592
    </delete>
 
593
  </target>
 
594
 
 
595
  
 
596
  <!-- These tasks require Clover -->
 
597
  <taskdef resource="clovertasks"/>
 
598
  
 
599
  <target name="with.clover" depends="init, -checkForClover">
 
600
    <mkdir dir="${clover.dir}"/>
 
601
    <clover-setup initString="${clover.dir}/xom_coverage.db">
 
602
       <files>
 
603
           <include name="nu/xom/**"/> <!-- work around Ant 1.6.3 bug  #34722 -->
 
604
               <exclude name="nu/xom/UnicodeUtil.java"/>
 
605
               <exclude name="nu/xom/Latin6Writer.java"/>
 
606
               <exclude name="nu/xom/Latin8Writer.java"/>
 
607
               <exclude name="nu/xom/Latin10Writer.java"/>
 
608
               <exclude name="nu/xom/tests/FastTests.java"/>
 
609
               <exclude name="nu/xom/tests/XOMTests.java"/>
 
610
               <exclude name="nu/xom/samples/**"/>
 
611
               <exclude name="nu/xom/pantry/**"/>
 
612
               <exclude name="nu/xom/benchmarks/**"/>
 
613
           <exclude name="nu/xom/tools/**" />
 
614
       </files>
 
615
    </clover-setup>
 
616
  </target>
 
617
 
 
618
  
 
619
  <property name="ant-home" value="/opt/ant"/>
 
620
 
 
621
  <target name="clover.html" depends="with.clover">
 
622
    <clover-report>
 
623
       <current outfile="clover_html" title="Clover results for ${Name} ${version}">
 
624
             <format type="html"/>
 
625
       </current>        
 
626
    </clover-report>
 
627
  </target>
 
628
  
 
629
 
 
630
  <!-- This task requires the ANT optional.jar. clover.jar, and junit.jar to be installed in ANT_HOME/lib -->
 
631
  <target name="clovertest" depends="compile, -checkForClover" description="Run JUnit tests with clover.jar in classpath">
 
632
    <junit printsummary="on" fork="no">
 
633
       <classpath refid="test.class.path" />
 
634
        <classpath>
 
635
          <pathelement path="${ant-home}/lib/clover.jar"/>
 
636
        </classpath>
 
637
        <formatter type="${test.outputFormat}" />
 
638
       <batchtest fork="yes" todir="${testoutput.dir}">
 
639
         <fileset dir="${build.src}">
 
640
           <include name="**/*Test.java" />
 
641
           <exclude name="**/pantry/*.java" />
 
642
           <exclude name="**/MegaTest.java" />
 
643
           <exclude name="**/benchmarks/*.java" />
 
644
           <exclude name="**/tools/*.java" />
 
645
           <exclude name="**/EBCDICTest.java" />
 
646
               <exclude name="nu/xom/tests/FastTests.java"/>
 
647
               <exclude name="nu/xom/tests/XOMTests.java"/>
 
648
         </fileset>
 
649
      </batchtest>
 
650
    </junit>
 
651
  </target> 
 
652
 
 
653
  <!-- This task requires the ANT optional.jar. clover.jar, and junit.jar to be installed in ANT_HOME/lib -->
 
654
  <target name="fastclover" depends="compile, -checkForClover" description="Run JUnit tests with clover.jar in classpath">
 
655
    <junit printsummary="on" fork="no">
 
656
       <classpath refid="test.class.path" />
 
657
        <classpath>
 
658
          <pathelement path="${ant-home}/lib/clover.jar"/>
 
659
        </classpath>
 
660
        <formatter type="${test.outputFormat}" />
 
661
       <batchtest fork="yes" todir="${testoutput.dir}">
 
662
         <fileset dir="${build.src}">
 
663
           <include name="**/*Test.java" />
 
664
           <exclude name="**/pantry/*.java" />
 
665
           <exclude name="**/EncodingTest.java" />
 
666
           <exclude name="**/XIncludeTest.java" />
 
667
           <exclude name="**/MegaTest.java" />
 
668
           <exclude name="**/benchmarks/*.java" />
 
669
           <exclude name="**/tools/*.java" />
 
670
           <exclude name="**/EBCDICTest.java" />
 
671
               <exclude name="nu/xom/tests/FastTests.java"/>
 
672
               <exclude name="nu/xom/tests/XOMTests.java"/>
 
673
         </fileset>
 
674
      </batchtest>
 
675
    </junit>
 
676
  </target> 
 
677
 
 
678
<!-- Generate a Maven JAR for uploading to the maven
 
679
    bug repository and hence placement onto ibiblio and mirrors. 
 
680
    See http://maven.apache.org/repository-upload.html -->
 
681
  <target name="maven" depends="jar" >
 
682
    <property name="pom.template" location="project.xml" />
 
683
    <property name="pom.file" location="${build.dir}/project.xml" />
 
684
    <property name="package.jar"
 
685
location="${build.dir}/${name}-${version}.jar"/>
 
686
    <property name="license" location="LICENSE.txt" />
 
687
    <property name="xom-maven.jar"
 
688
location="${dist.dir}/xom-maven-${version}.jar" />
 
689
    <copy file="${pom.template}" tofile="${pom.file}">
 
690
      <filterset>
 
691
       <filter token="VERSION" value="${version}"/>
 
692
     </filterset>
 
693
    </copy>
 
694
    <jar destFile="${xom-maven.jar}">
 
695
      <fileset file="${pom.file}" />
 
696
      <fileset file="${license}" />
 
697
      <fileset file="${package.jar}" />
 
698
    </jar>
 
699
  </target>
 
700
 
 
701
  <target name="compile-jaxen" description="Compile Jaxen" depends="get-jaxen">
 
702
    <javac srcdir="${build.dir}/jaxen/src/java/main"
 
703
           destdir="${build.dir}/jaxen-classes"
 
704
           debug="${debug}"
 
705
           optimize="${optimize}"
 
706
           deprecation="${deprecation}"
 
707
           target="1.2"
 
708
           source="1.3"
 
709
           encoding="UTF-8"
 
710
           includeAntRuntime="no"
 
711
           excludes="org/jaxen/dom/** 
 
712
                     org/jaxen/jdom/** 
 
713
                     org/jaxen/dom4j/** 
 
714
                     org/jaxen/pattern/** 
 
715
                     org/jaxen/javabean/** 
 
716
                     org/jaxen/xom/**
 
717
                     org/jaxen/function/xslt/**
 
718
                     org/jaxen/function/ext/**
 
719
                     org/jaxen/saxpath/expr/DefaultPredicated.java
 
720
                     org/jaxen/saxpath/helpers/DefaultXPathHandler.java
 
721
                     org/jaxen/util/StackedIterator.java
 
722
                     org/jaxen/util/XPath2XMLVisitor.java
 
723
                     org/jaxen/util/LinkedIterator.java
 
724
                     org/jaxen/util/SelfAxisIterator.java
 
725
                     ">
 
726
       <classpath refid="compile.class.path"/>
 
727
    </javac>  
 
728
  </target>
 
729
  
 
730
  <target name="get-jaxen" description="Download Jaxen source code" depends="prepare">
 
731
      <cvs cvsRoot=":pserver:anonymous@cvs.jaxen.codehaus.org:/home/projects/jaxen/scm"
 
732
       package="jaxen"
 
733
       dest="${build.dir}"
 
734
  />
 
735
  </target>
 
736
 
 
737
  <target name="debug" depends="init" description="Print various Ant properties">
 
738
    <echoproperties/>
 
739
    <java classname="org.apache.xalan.Version" fork="yes">
 
740
      <classpath refid="test.class.path" />
 
741
    </java>
 
742
  </target>
 
743
  
 
744
</project>