~ubuntu-branches/debian/sid/xom/sid

« back to all changes in this revision

Viewing changes to .pc/0006-disable-filtering-for-ant-s-copy-task.patch/build.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2010-02-25 20:16:46 UTC
  • Revision ID: james.westby@ubuntu.com-20100225201646-w3ylayyeqx9ratu1
Tags: 1.2.1-2
* Convert patches to dep3 format.
* Add a patch for ant 1.8. (Closes: #571391)
* Fine tune build dependencies to default-jdk.
* Convert to source format 3.0.
* Update Standards-Version: 3.8.4.

Show diffs side-by-side

added added

removed removed

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