As mentioned on dev@ - zap the old, initial OOXML code out of trunk. It isn't compati...
[poi.git] / build.xml
blobcdcd7924e22c06c2d46ceef6543c3823e83d064c
1 <?xml version="1.0"?>
2 <!-- 
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements.  See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership.  The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License.  You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied.  See the License for the
17 specific language governing permissions and limitations
18 under the License.
19 -->
20 <!DOCTYPE project PUBLIC "-//Ant//Project 1.5//EN" "ant.dtd">
22 <!--
23     POI Build System.  Written by:
25         Glen Stampoultzis   glens at apache.org
27     Modified by:
29         Rainer Klute        klute@rainer-klute.de
31     This build was tested with ant 1.6.2 although it will probably work with
32     other versions.  The following jar files should be available on the 
33     classpath when running ant:
35     LIBRARY         LOCATION
36     =======         ========
37     junit(3.8+)     http://www.ibiblio.org/maven/junit/jars/
38     xerces          http://www.ibiblio.org/maven/xerces/jars/
39     jdepend         http://www.ibiblio.org/maven/jdepend/jars/
40     xalan           http://www.ibiblio.org/maven/xalan/jars/
42     The ant jar "optional.jar" should also be available otherwise the
43     build will fail.
45     To build the documentation you will need to install forrest and set
46     the FORREST_HOME environment variable.  Forrest 0.5.1 required.
48     Some people may find the tests hang when run through Ant. If this
49     happens to you, try giving Ant some more memory when you run it, eg:
50           ANT_OPTS="-Xmx1024m -XX:MaxPermSize=256m" ant test
53     TO BE COMPLETED:
55     Convert book.xml files to a sitemap.
57  -->
58 <project name="POI Build" default="help" basedir=".">
60   <description>
61     The POI project Ant build.
62   </description>
64   <property environment="env"/>
66   <property name="repository" value="http://www.ibiblio.org/maven"/>
67   <property name="forrest.home" value="${env.FORREST_HOME}"/>
69   <!-- Main: -->
70   <property name="main.resource1.dir" value="src/resources/main"/>
71   <property name="main.src" location="src/java"/>
72   <property name="main.src.test" location="src/testcases"/>
73   <property name="main.documentation" value="src/documentation"/>
74   <property name="main.output.dir" location="build/classes"/>
75   <property name="main.output.test.dir" location="build/test-classes"/>
76   <property name="main.lib" location="lib"/>
77   <property name="main.reports.test" location="build/test-results"/>
78   <property name="main.jar1.dir" location="${main.lib}/commons-logging-1.1.jar"/>
79   <property name="main.jar1.url" value="${repository}/commons-logging/jars/commons-logging-1.1.jar"/>
80   <property name="main.jar2.dir" location="${main.lib}/log4j-1.2.13.jar"/>
81   <property name="main.jar2.url" value="${repository}/log4j/jars/log4j-1.2.13.jar"/>
82   <property name="main.testokfile" location="build/main-testokfile.txt"/>
84   <property name="junit.jar1.dir" location="${main.lib}/junit-3.8.1.jar"/>
85   <property name="junit.jar1.url" value="${repository}/junit/jars/junit-3.8.1.jar"/>
87   <!-- Scratchpad: -->
88   <property name="scratchpad.src" location="src/scratchpad/src"/>
89   <property name="scratchpad.src.test" location="src/scratchpad/testcases"/>
90   <property name="scratchpad.lib" location="src/scratchpad/lib"/>
91   <property name="scratchpad.reports.test" location="build/scratchpad-test-results"/>
92   <property name="scratchpad.output.dir" location="build/scratchpad-classes"/>
93   <property name="scratchpad.output.test.dir" location="build/scratchpad-test-classes"/>
94   <property name="scratchpad.testokfile" location="build/scratchpad-testokfile.txt"/>
96   <!-- Contributed software: -->
97   <property name="contrib.src" location="src/contrib/src"/>
98   <property name="contrib.src.test" location="src/contrib/testcases"/>
99   <property name="contrib.lib" location="src/contrib/lib"/>
100   <property name="contrib.reports.test" location="build/contrib-test-results"/>
101   <property name="contrib.output.dir" location="build/contrib-classes"/>
102   <property name="contrib.output.test.dir" location="build/contrib-test-classes"/>
103   <property name="contrib.jar1.dir" location="${contrib.lib}/commons-beanutils-1.7.0.jar"/>
104   <property name="contrib.jar1.url" value="${repository}/commons-beanutils/jars/commons-beanutils-1.7.0.jar"/>
105   <property name="contrib.jar2.dir" location="${contrib.lib}/commons-collections-3.2.jar"/>
106   <property name="contrib.jar2.url" value="${repository}/commons-collections/jars/commons-collections-3.2.jar"/>
107   <property name="contrib.jar3.dir" location="${contrib.lib}/commons-lang-2.1.jar"/>
108   <property name="contrib.jar3.url" value="${repository}/commons-lang/jars/commons-lang-2.1.jar"/>
109   <property name="contrib.testokfile" location="build/contrib-testokfile.txt"/>
111   <!-- Examples: -->
112   <property name="examples.src" location="src/examples/src"/>
113   <property name="examples.src.test" location="src/examples/testcases"/>
114   <property name="examples.lib" location="src/examples/lib"/>
115   <property name="examples.reports.test" location="build/examples-test-results"/>
116   <property name="examples.output.dir" location="build/examples-classes"/>
117   <property name="examples.output.test.dir" location="build/examples-test-classes"/>
118   <property name="examples.jar1.dir" location="${examples.lib}/commons-beanutils-1.7.0.jar"/>
119   <property name="examples.jar1.url" value="${repository}/commons-beanutils/jars/commons-beanutils-1.7.0.jar"/>
120   <property name="examples.jar2.dir" location="${examples.lib}/commons-collections-3.2.jar"/>
121   <property name="examples.jar2.url" value="${repository}/commons-collections/jars/commons-collections-3.2.jar"/>
122   <property name="examples.jar3.dir" location="${examples.lib}/commons-lang-2.1.jar"/>
123   <property name="examples.jar3.url" value="${repository}/commons-lang/jars/commons-lang-2.1.jar"/>
124   <property name="examples.testokfile" location="build/examples-testokfile.txt"/>
126   <property name="build.site" location="build/tmp/site/build/site"/>
127   <property name="build.site.src" location="build/tmp/site"/>
128   <property name="junit.report.dir" location="${build.site}/junit"/>
129   <property name="jdepend.report.dir" location="${build.site}/jdepend"/>
130   <property name="jdepend.report.out.dir" location="${build.site.src}/src/documentation/content/jdepend"/>
131   <property name="apidocs.report.dir" location="${build.site}/apidocs"/>
132   <property name="changelog.file" location="${build.site}/changelog.html"/>
133   <property name="dist.dir" location="build/dist"/>
134   <property name="mavendist.dir" location="build/maven-dist"/>
135   <property name="mavendist.poi.dir" location="build/maven-dist/poi"/>
136   <property name="mavendist.oap.dir" location="build/maven-dist/org.apache.poi"/>
137   <property name="jar.name" value="poi"/>
138   <property name="version.id" value="3.1-beta1"/>
139   <property name="halt.on.test.failure" value="true"/>
140   <property name="jdk.version.source" value="1.3"
141     description="JDK version of source code"/>
142   <property name="jdk.version.class" value="1.3"
143     description="JDK version of generated class files"/>  
146     <path id="main.classpath">
147         <pathelement location="${main.jar1.dir}"/>
148         <pathelement location="${main.jar2.dir}"/>
149         <pathelement location="${main.resource1.dir}"/>
150     </path>
152     <path id="scratchpad.classpath">
153         <path refid="main.classpath"/>
154         <pathelement location="${main.output.dir}"/>
155     </path>
157     <path id="contrib.classpath">
158         <path refid="main.classpath"/>
159         <pathelement location="${contrib.jar1.dir}"/>
160         <pathelement location="${contrib.jar2.dir}"/>
161         <pathelement location="${contrib.jar3.dir}"/>
162         <pathelement location="${main.output.dir}"/>
163         <pathelement location="${main.output.test.dir}"/>
164         <pathelement location="${scratchpad.output.dir}"/>
165         <pathelement location="${scratchpad.output.test.dir}"/>
166         <pathelement location="${contrib.output.dir}"/>
167         <pathelement location="${contrib.output.test.dir}"/>
168     </path>
170   <path id="examples.classpath">
171     <path refid="main.classpath"/>
172     <pathelement location="${main.output.dir}"/>
173   </path>
177   <!-- Prints POI's Ant usage help -->
178   <target name="help" description="Prints POI's Ant usage help">
179     <echo>
180       - Execute "ant -projecthelp" to view a listing of the main build
181         targets.
182       - Execute "ant help-properties" to view a listing of some properties
183         controlling the build process.
184     </echo>
185   </target>
189   <target name="help-properties"
190     description="Prints a listing of build controlling properties">
191     <echo>
192       The following properties control the build process:
194       -Ddisconnected="true": Do not execute any targets that require an online
195           connection to the Internet.
196       -Dtestcase=org.apache.poi.xxx.xxx : for the single-test target, specify
197               the test to run
199       WARNING: This list is not exhaustive.
200     </echo>
201   </target>
205     <target name="with.clover" if="clover.present">
206         <taskdef resource="clovertasks"/>
207         <clover-setup initString="mycoverage.db"/>
208     </target>
210     <target name="clover.html" depends="with.clover" if="clover.present">
211         <echo>Generating clover report</echo>
212        <clover-report>
213           <current outfile="build/tmp/site/build/site/clover_html">
214              <format type="html"/>
215           </current>
216        </clover-report>
217     </target>
219     <target name="init" depends="check-jars,fetch-jars">
221         <tstamp>
222           <format property="tstamp.year" pattern="yyyy"/>
223         </tstamp>
225         <available resource="clovertasks" property="clover.present"/>
226         <antcall target="with.clover"/>
227         
228         <mkdir dir="build"/>
229         <mkdir dir="build/non-ant-classes"/>
230         <mkdir dir="${main.output.dir}"/>
231         <mkdir dir="${scratchpad.output.dir}"/>
232         <mkdir dir="${contrib.output.dir}"/>
233         <mkdir dir="${examples.output.dir}"/>
234         <mkdir dir="${main.output.test.dir}"/>
235         <mkdir dir="${contrib.output.test.dir}"/>
236         <mkdir dir="${scratchpad.output.test.dir}"/>
237         <mkdir dir="${main.reports.test}"/>
238         <mkdir dir="${scratchpad.reports.test}"/>
239         <mkdir dir="${contrib.reports.test}"/>
240         <mkdir dir="${junit.report.dir}"/>
241         <mkdir dir="${jdepend.report.dir}"/>
242         <mkdir dir="${jdepend.report.out.dir}"/>
243         <mkdir dir="${apidocs.report.dir}"/>
244         <mkdir dir="${dist.dir}"/>
245         <mkdir dir="${build.site.src}/${main.documentation}"/>
247         <mkdir dir="${mavendist.dir}"/>
248         <mkdir dir="${mavendist.poi.dir}"/>
249         <mkdir dir="${mavendist.poi.dir}/poms"/>
250         <mkdir dir="${mavendist.oap.dir}"/>
251         <mkdir dir="${mavendist.oap.dir}/jars"/>
252         <mkdir dir="${mavendist.oap.dir}/poms"/>
254         <copy todir="${build.site.src}/${main.documentation}">
255             <fileset dir="${main.documentation}"/>
256         </copy>
257         <copy file="forrest.properties" tofile="${build.site.src}/forrest.properties"/>
258     </target>
260     <target name="clean">
261         <delete dir="build"/>
262     </target>
264     <target name="check-jars">
265         <condition property="jars.present">
266             <or>
267                 <and>
268                     <available file="${main.jar1.dir}"/>
269                     <available file="${main.jar2.dir}"/>
270                     <available file="${contrib.jar1.dir}"/>
271                     <available file="${contrib.jar2.dir}"/>
272                     <available file="${contrib.jar3.dir}"/>
273                     <available file="${junit.jar1.dir}"/>
274                 </and>
275                 <isset property="disconnected"/>
276             </or>
277         </condition>
278     </target>
280     <target name="fetch-jars" unless="jars.present"
281      description="Fetches needed JAR files from the Internet">
282         <get src="${main.jar1.url}" dest="${main.jar1.dir}"/>
283         <get src="${main.jar2.url}" dest="${main.jar2.dir}"/>
284         <get src="${contrib.jar1.url}" dest="${contrib.jar1.dir}"/>
285         <get src="${contrib.jar2.url}" dest="${contrib.jar2.dir}"/>
286         <get src="${contrib.jar3.url}" dest="${contrib.jar3.dir}"/>
287         <get src="${junit.jar1.url}" dest="${junit.jar1.dir}"/>
288     </target>
290   <target name="compile" depends="init, compile-main, compile-scratchpad,
291     compile-contrib, compile-examples"
292     description="Compiles the POI main classes, scratchpad, contrib, and examples"/>
294   <target name="compile-main" depends="fail-unless-xslt-is-available">
295     <copy todir="${main.output.dir}">
296       <fileset dir="${main.resource1.dir}"/>
297     </copy>
298     <javac target="${jdk.version.class}" source="${jdk.version.source}"
299       failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes"
300       srcdir="${main.src}">
301       <classpath refid="main.classpath"/>
302     </javac>
303     <javac target="${jdk.version.class}" source="${jdk.version.source}"
304       failonerror="true" destdir="${main.output.test.dir}" debug="on"
305       fork="yes" srcdir="${main.src.test}">
306       <classpath>
307         <path refid="main.classpath"/>
308         <pathelement location="${main.output.dir}"/>
309         <pathelement location="${junit.jar1.dir}"/>
310       </classpath>
311     </javac>
312   </target>
314   <target name="compile-scratchpad" depends="init,compile-main">
315     <javac target="${jdk.version.class}" source="${jdk.version.source}"
316       failonerror="true" destdir="${scratchpad.output.dir}" debug="on"
317       fork="yes" srcdir="${scratchpad.src}">
318       <classpath refid="scratchpad.classpath"/>
319     </javac>
320     <javac target="${jdk.version.class}" source="${jdk.version.source}"
321       failonerror="true" destdir="${scratchpad.output.test.dir}" debug="on"
322       fork="yes" srcdir="${scratchpad.src.test}">
323       <classpath>
324         <path refid="scratchpad.classpath"/>
325         <pathelement location="${scratchpad.output.dir}"/>
326         <pathelement location="${junit.jar1.dir}"/>
327       </classpath>
328     </javac>
330         <!-- Copy HSLF Resources over -->
331         <property name="hslf.data" value="org/apache/poi/hslf/data" />
332         <mkdir dir="${scratchpad.output.dir}/${hslf.data}" />
333         <copy todir="${scratchpad.output.dir}/${hslf.data}">
334                 <fileset dir="${scratchpad.src}/${hslf.data}">
335                         <include name="*.ppt" />
336                 </fileset>
337         </copy>
339         <!-- Copy HDGF Resources over -->
340         <property name="hdgf.chunks" value="org/apache/poi/hdgf/chunks" />
341         <copy todir="${scratchpad.output.dir}/${hdgf.chunks}">
342                 <fileset dir="${scratchpad.src}/${hdgf.chunks}">
343                         <include name="*.tbl" />
344                 </fileset>
345         </copy>
346   </target>
348   <target name="compile-contrib" depends="init">
349     <javac target="${jdk.version.class}" source="${jdk.version.source}"
350       failonerror="true" destdir="${contrib.output.dir}" debug="on" fork="yes"
351       srcdir="${contrib.src}">
352       <classpath refid="contrib.classpath"/>
353     </javac>
354     <javac target="${jdk.version.class}" source="${jdk.version.source}"
355       failonerror="true" destdir="${contrib.output.test.dir}" debug="on"
356       fork="yes" srcdir="${contrib.src.test}">
357       <classpath>
358         <path refid="contrib.classpath"/>
359         <pathelement location="${contrib.output.dir}"/>
360         <pathelement location="${junit.jar1.dir}"/>
361       </classpath>
362     </javac>
363   </target>
365   <target name="compile-examples" depends="init">
366     <javac target="${jdk.version.class}" source="${jdk.version.source}"
367       destdir="${examples.output.dir}" debug="on" srcdir="${examples.src}">
368       <classpath refid="examples.classpath"/>
369     </javac>
370   </target>
372   <target name="test" depends="test-main,test-scratchpad,test-contrib"
373     description="Tests main, contrib and scratchpad"/>
375     <target name="-test-main-check">
376         <uptodate property="main.test.notRequired" targetfile="${main.testokfile}">
377             <srcfiles dir="${main.src}"/>
378             <srcfiles dir="${main.src.test}"/>
379         </uptodate>
380     </target>
382     <path id="test.classpath">
383         <path refid="main.classpath"/>
384         <pathelement location="${main.output.dir}"/>
385         <pathelement location="${main.output.test.dir}"/>
386         <pathelement location="${junit.jar1.dir}"/>
387     </path>
389   <target name="test-main" unless="main.test.notRequired"
390     depends="compile-main, -test-main-check, fail-unless-junit-is-available">
391     <junit fork="no" printsummary="yes" haltonfailure="${halt.on.test.failure}"
392       failureproperty="main.test.failed" showoutput="true">
393       <classpath refid="test.classpath"/>
394       <sysproperty key="HSSF.testdata.path"
395         file="${main.src.test}/org/apache/poi/hssf/data"/> 
396       <sysproperty key="HSLF.testdata.path"
397         file="${main.src.test}/org/apache/poi/hslf/data"/> 
398       <sysproperty key="HWPF.testdata.path"
399         file="${main.src.test}/org/apache/poi/hwpf/data"/> 
400       <sysproperty key="HPSF.testdata.path"
401         file="${main.src.test}/org/apache/poi/hpsf/data"/> 
402       <sysproperty key="POIFS.testdata.path"
403         file="${main.src.test}/org/apache/poi/poifs/data"/> 
404       <sysproperty key="java.awt.headless" value="true"/>
405       <formatter type="plain"/>
406       <formatter type="xml"/>
407       <batchtest todir="${main.reports.test}">
408         <fileset dir="${main.src.test}">
409           <include name="**/Test*.java"/>
410           <exclude name="**/All*Tests.java"/>
411           <exclude name="**/TestUnfixedBugs.java"/>
412           <exclude name="**/TestcaseRecordInputStream.java"/>
413         </fileset>
414       </batchtest>
415     </junit>
416     <delete file="${main.testokfile}"/>
417     <antcall target="-test-main-write-testfile"/>
418   </target>
420   <target name="test-fail" depends="compile-main,
421     fail-unless-junit-is-available"
422     description="run tests that are known to fail">
423     <junit printsummary="yes" showoutput="true" filtertrace="no"
424       haltonfailure="false">
425       <classpath refid="test.classpath"/>
426       <classpath>
427         <path refid="scratchpad.classpath"/>
428         <pathelement location="${main.output.dir}"/>
429         <pathelement location="${scratchpad.output.dir}"/>
430         <pathelement location="${scratchpad.output.test.dir}"/>
431         <pathelement location="${junit.jar1.dir}"/>
432       </classpath>
433       <sysproperty key="HSSF.testdata.path"
434         file="${main.src.test}/org/apache/poi/hssf/data"/>
435       <sysproperty key="HPSF.testdata.path"
436         file="${main.src.test}/org/apache/poi/hpsf/data"/>
437       <sysproperty key="HWPF.testdata.path"
438         file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
439       <sysproperty key="POIFS.testdata.path"
440         file="${main.src.test}/org/apache/poi/poifs/data"/> 
441       <sysproperty key="java.awt.headless" value="true"/>
442       <formatter type="plain" usefile="no"/>
443       <batchtest todir="${main.reports.test}">
444         <fileset dir="${main.src.test}">
445           <include name="**/TestEmptyDocument.java"/>
446           <include name="**/TestUnfixedBugs.java"/>
447         </fileset>
448       </batchtest>
449     </junit>
450   </target>        
454     <target name="single-test" depends="-test-property-check,compile-main" description="Runs a single test case specified with -Dtestcase=classname">
455         <junit printsummary="yes" showoutput="true" filtertrace="no" haltonfailure="false" >
456             <classpath refid="test.classpath"/>
457                  <classpath>
458                                 <path refid="test.classpath"/>
459                                 <pathelement location="${main.output.dir}"/>
460                                 <pathelement location="${scratchpad.output.dir}"/>
461                                 <pathelement location="${scratchpad.output.test.dir}"/>
462                                 <pathelement location="${junit.jar1.dir}"/>
463                             </classpath>
464             <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
465             <sysproperty key="HPSF.testdata.path" file="${main.src.test}/org/apache/poi/hpsf/data"/>
466             <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
467             <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
468             <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
469             <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
470             <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/> 
471                 <sysproperty key="java.awt.headless" value="true"/>
472             <formatter type="plain" usefile="no"/>
473             <formatter type="xml"/>
474             <test name="${testcase}"/>
475         </junit>
476     </target>
478     <target name="debug-test" depends="-test-property-check,compile-main" description="Runs a single test case specified with -Dtestcase=classname with remote debug options turned on." >
479             <echo>Waiting for debugger on port 5001</echo>    
480         <junit printsummary="no" showoutput="true" filtertrace="no" fork="yes" haltonfailure="${halt.on.test.failure}" failureproperty="main.test.failed">
481             <jvmarg value="-Xdebug"/>
482             <jvmarg value="-Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=y"/>
483             <sysproperty key="java.compiler" value="NONE"/>
484             <classpath refid="test.classpath"/>
485             <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
486             <sysproperty key="HPSF.testdata.path" file="${main.src.test}/org/apache/poi/hpsf/data"/>
487             <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/> 
488             <sysproperty key="java.awt.headless" value="true"/>
489             <formatter type="plain" usefile="no"/>
490             <test name="${testcase}"/>
491         </junit>
492     </target>
494     <target name="-test-property-check" unless="testcase">
495         <echo message="Please use -Dtestcase=org.your.testcase to run a single test"/>
496         <fail/>
497     </target>
499     <target name="-test-main-write-testfile" unless="main.test.failed">
500         <echo file="${main.testokfile}" append="false" message="testok"/>
501     </target>
503     <target name="-test-scratchpad-check">
504         <uptodate property="scratchpad.test.notRequired" targetfile="${scratchpad.testokfile}">
505             <srcfiles dir="${scratchpad.src}"/>
506             <srcfiles dir="${scratchpad.src.test}"/>
507         </uptodate>
508     </target>
510     <target name="test-scratchpad" depends="compile-main,compile-scratchpad,-test-scratchpad-check" unless="scratchpad.test.notRequired">
511         <junit printsummary="yes" fork="no" haltonfailure="${halt.on.test.failure}" failureproperty="scratchpad.test.failed">
512             <classpath>
513                 <path refid="scratchpad.classpath"/>
514                 <pathelement location="${main.output.dir}"/>
515                 <pathelement location="${scratchpad.output.dir}"/>
516                 <pathelement location="${scratchpad.output.test.dir}"/>
517                 <pathelement location="${junit.jar1.dir}"/>
518             </classpath>
519             <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
520             <sysproperty key="HPSF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hpsf/data"/>
521             <sysproperty key="HDF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdf/data"/>
522             <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
523             <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
524             <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
525             <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
526             <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/> 
527             <sysproperty key="java.awt.headless" value="true"/>
528             <formatter type="plain"/>
529             <formatter type="xml"/>
530             <batchtest todir="${scratchpad.reports.test}">
531                 <fileset dir="${scratchpad.src.test}">
532                     <include name="**/Test*.java"/>
533                     <exclude name="**/AllTests.java"/>
534                 </fileset>
535             </batchtest>
536         </junit>
537         <delete file="${scratchpad.testokfile}"/>
538         <antcall target="-test-scratchpad-write-testfile"/>
539     </target>
541     <target name="-test-scratchpad-write-testfile" unless="scratchpad.test.failed">
542         <echo file="${scratchpad.testokfile}" append="false" message="testok"/>
543     </target>
545         <target name="single-scratchpad-test" depends="compile-scratchpad,-test-property-check" description="Runs a single test case specified with -Dtestcase=classname">
546                 <junit printsummary="yes" showoutput="true" filtertrace="no" haltonfailure="false" >
547                     <classpath refid="test.classpath"/>
548                          <classpath>
549                                         <path refid="scratchpad.classpath"/>
550                                         <pathelement location="${main.output.dir}"/>
551                                         <pathelement location="${scratchpad.output.dir}"/>
552                                         <pathelement location="${scratchpad.output.test.dir}"/>
553                                         <pathelement location="${junit.jar1.dir}"/>
554                                     </classpath>
555                 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
556                     <sysproperty key="HPSF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hpsf/data"/>
557                     <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
558                 <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
559                 <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
560                 <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
561                 <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/> 
562                     <sysproperty key="java.awt.headless" value="true"/>
563                         <sysproperty key="java.awt.headless" value="true"/>
564                     <formatter type="plain" usefile="no"/>
565                     <formatter type="xml"/>
566                     <test name="${testcase}"/>
567                 </junit>
568             </target>
569         
570     <target name="-test-contrib-check">
571         <uptodate property="contrib.test.notRequired" targetfile="${contrib.testokfile}">
572             <srcfiles dir="${contrib.src}"/>
573             <srcfiles dir="${contrib.src.test}"/>
574         </uptodate>
575     </target>
577     <target name="test-contrib" depends="compile-main,compile-contrib,-test-contrib-check" unless="contrib.test.notRequired">
578         <junit printsummary="yes" fork="no" haltonfailure="${halt.on.test.failure}" failureproperty="contrib.test.failed">
579             <classpath>
580                 <path refid="contrib.classpath"/>
581                 <pathelement location="${main.output.dir}"/>
582                 <pathelement location="${contrib.output.dir}"/>
583                 <pathelement location="${contrib.output.test.dir}"/>
584                 <pathelement location="${junit.jar1.dir}"/>
585             </classpath>
586             <sysproperty key="HSSF.testdata.path" file="${contrib.src.test}/org/apache/poi/hssf/data"/>
587             <sysproperty key="HPSF.testdata.path" file="${contrib.src.test}/org/apache/poi/hpsf/data"/>
588             <sysproperty key="java.awt.headless" value="true"/>
589             <formatter type="plain"/>
590             <formatter type="xml"/>
591             <batchtest todir="${contrib.reports.test}">
592                 <fileset dir="${contrib.src.test}">
593                     <include name="**/Test*.java"/>
594                     <exclude name="**/AllTests.java"/>
595                 </fileset>
596             </batchtest>
597         </junit>
598         <delete file="${contrib.testokfile}"/>
599         <antcall target="-test-contrib-write-testfile"/>
600     </target>
602     <target name="-test-contrib-write-testfile" unless="contrib.test.failed">
603         <echo file="${contrib.testokfile}" append="false" message="testok"/>
604     </target>
606     <target name="-check-docs">
607         <uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html">
608             <srcfiles dir="${build.site.src}"/>
609         </uptodate>
610     </target>
612     <target name="-check-forrest-installed" unless="env.FORREST_HOME">
613         <echo>Please install Apache Forrest (see
614 &lt;http://xml.apache.org/forrest/index.html&gt;) and set the
615 FORREST_HOME environment variable!</echo>
616         <fail message="Apache Forrest is not installed."/>
617     </target>
619     <!--    <target name="check-docs">-->
620     <!--        <uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html" >-->
621     <!--            <srcfiles dir= "${build.site.src}"/>-->
622     <!--        </uptodate>-->
623     <!--    </target>-->
625     <target name="docs" depends="init, -check-forrest-installed, -check-docs"
626       unless="main.docs.notRequired" description="Builds the POI website">
628         <mkdir dir="${build.site.src}/src/documentation/content/apidocs"/>
629         <copy todir="${build.site.src}/src/documentation/content/apidocs">
630             <fileset dir="${apidocs.report.dir}"/>
631         </copy>
632         <copy
633           tofile="${build.site.src}/src/documentation/content/jdepend.ehtml"
634           file="${jdepend.report.dir}/index.html" failonerror="false"/>
635         <mkdir dir="${build.site.src}/src/documentation/content/junit"/>
636         <copy todir="${build.site.src}/src/documentation/content/junit">
637             <fileset dir="${junit.report.dir}"/>
638         </copy>
640         <move
641           file="${build.site.src}/src/documentation/content/xdocs/status.xml"
642           tofile="${build.site.src}/status.xml"/>
644         <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site">
645             <property name="project.home" location="${build.site.src}"/>
646         </ant>
648         <echo>Broken links:</echo>
649         <echo file="${build.site}/../tmp/brokenlinks.txt"/>
651         <touch>
652             <fileset dir="${build.site}"/>
653         </touch>
654     </target>
656     <!-- Checks whether reports are required to be run.  If nothing has changed then they dont. -->
657     <target name="-check-reports">
658         <condition property="reports.notRequired">
659             <and>
660                 <equals arg1="${main.test.notRequired}" arg2="true"/>
661                 <equals arg1="${scratchpad.test.notRequired}" arg2="true"/>
662                 <equals arg1="${contrib.test.notRequired}" arg2="true"/>
663             </and>
664         </condition>
665     </target>
669   <!-- Generates a log of the latest changes in the CVS repository. -->
670   <target name="cvschangelog" unless="disconnected"
671     depends="fail-unless-xslt-is-available"
672     description="Generates a CVS change log report">
673     <antcall target="cvs-rsh-warning"/>
674     <cvschangelog destfile="${changelog.file}" daysinpast="30"/>
676     <style in="${changelog.file}"
677       out="${build.site.src}/src/documentation/content/changelog.html"
678       style="changelog.xsl">
679       <param name="title"  expression="POI Change Log"/>
680       <param name="module" expression="jakarta-poi"/>
681       <param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
682     </style>
683   </target>
685   <target name="cvs-rsh-warning" unless="env.CVS_RSH">
686     <echo>
687       WARNING: The environment variable CVS_RSH is not set. If you cannot
688       access the CVS repository this could be one of the reasons for the
689       failure.
690     </echo>
691   </target>
695   <!-- Creates reports and API documentation -->
696   <target name="reports" unless="reports.notRequired" depends="-check-reports,
697     fail-unless-xslt-is-available, fail-unless-junit-is-available,
698     fail-unless-jdepend-is-available, test-ignore-failures, junitreport,
699     jdepend, cvschangelog, javadocs, clover.html"
700     description="Creates various reports and the API documentation">
701   </target>
705   <!-- Runs all JUnit tests without aborting if one of the tests fails. -->
706   <target name="test-ignore-failures" depends="init">
707     <antcall target="test">
708       <param name="halt.on.test.failure" value="false"/>
709     </antcall>
710   </target>
714   <!-- Produces a report of the JUnit test results -->
715   <target name="junitreport"
716     depends="fail-unless-xslt-is-available, test-ignore-failures"
717     description="Produces a report of the JUnit test results">
718     <junitreport todir="${junit.report.dir}">
719       <fileset dir="${main.reports.test}">
720         <include name="TEST-*.xml"/>
721       </fileset>
722       <fileset dir="${scratchpad.reports.test}">
723         <include name="TEST-*.xml"/>
724       </fileset>
725       <fileset dir="${contrib.reports.test}">
726         <include name="TEST-*.xml"/>
727       </fileset>
728       <report format="frames" todir="${junit.report.dir}"/>
729     </junitreport>
730   </target>
734   <!-- Generates the API documentation. -->
735   <target name="javadocs" depends="init, warn-unless-junit-is-available,
736     warn-unless-xslt-is-available"
737     description="Generates the API documentation">
738     <javadoc verbose="false" author="true" destdir="${apidocs.report.dir}"
739       windowtitle="POI API Documentation" use="true" version="true">
741       <packageset dir="${main.src}" defaultexcludes="yes">
742         <include name="org/apache/poi/**"/>
743       </packageset>
744       <packageset dir="${scratchpad.src}" defaultexcludes="yes">
745         <include name="org/apache/poi/**"/>
746         <exclude name="org/apache/poi/hdf/**"/>
747       </packageset>
748       <packageset dir="${contrib.src}" defaultexcludes="yes">
749         <include name="org/apache/poi/**"/>
750       </packageset>
751       <packageset dir="${examples.src}" defaultexcludes="yes">
752         <include name="org/apache/poi/**"/>
753       </packageset>
755       <classpath id="javadoc.classpath">
756         <path refid="main.classpath"/>
757         <path refid="scratchpad.classpath"/>
758         <path refid="contrib.classpath"/>
759         <path refid="examples.classpath"/>
760         <path path="${env.CLASSPATH}"/>
761       </classpath>
763       <doctitle><![CDATA[<h1>POI API Documentation</h1>]]></doctitle>
764       <bottom>
765         <![CDATA[<i>Copyright ${tstamp.year} The Apache Software Foundation or
766         its licensors, as applicable.</i>]]>
767       </bottom>
768       <group>
769         <title>DDF - Dreadful Drawing Format</title>
770         <package name="org.apache.poi.ddf*"/>
771       </group>
772       <group>
773         <title>HPSF - Horrible Property Set Format</title>
774         <package name="org.apache.poi.hpsf*"/>
775       </group>
776       <group>
777         <title>HSSF - Horrible Spreadsheet Format</title>
778         <package name="org.apache.poi.hssf*"/>
779       </group>
780       <group>
781         <title>HWPF - Horrible Word Processor Format</title>
782         <package name="org.apache.poi.hwpf*"/>
783       </group>
784       <group>
785         <title>POIFS - POI File System</title>
786         <package name="org.apache.poi.poifs*"/>
787       </group>
788       <group>
789         <title>Utilities</title>
790         <package name="org.apache.poi.util*"/>
791       </group>
792       <group>
793         <title>Examples</title>
794         <package name="org.apache.poi.hpsf.examples*"/>
795         <package name="org.apache.poi.hssf.usermodel.examples*"/>
796       </group>
797     </javadoc>
799     <antcall target="clover.html"/>
800   </target>
804   <!-- ================================== -->
805   <!--       Generate records                -->
806   <!-- ================================== -->
808   <target name="generate-records" depends="init"
809     description="Generates HSSF records"> 
810     <java classname="org.apache.poi.dev.RecordGenerator" fork="yes">
811       <arg file="src/records/definitions"/>
812       <arg file="src/records/styles"/>
813       <arg file="src/java"/>
814       <arg file="src/testcases"/>
815       <classpath>
816         <path refid="scratchpad.classpath"/>
817         <pathelement location="${main.output.dir}"/>
818         <pathelement location="${scratchpad.output.dir}"/>
819       </classpath>
820     </java>  
821   </target>
823   <!-- ================================== -->
824   <!--       Generate types               -->
825   <!-- ================================== -->
827   <target name="generate-types" depends="init"
828     description="Generates word types">
829     <java classname="org.apache.poi.dev.RecordGenerator" fork="yes">
830       <arg file="src/types/definitions"/>
831       <arg file="src/types/styles"/>
832       <arg file="src/scratchpad/src"/>
833       <arg file="src/scratchpad/testcases"/>
834       <classpath>
835         <path refid="scratchpad.classpath">
836         </path>
837         <pathelement location="${main.output.dir}"/>
838         <pathelement location="${scratchpad.output.dir}"/>
839       </classpath>
840     </java>
841   </target>
845     <!-- Generates documentation and reports -->
846     <target name="site" depends="reports, docs"
847       description="Generates POI's website's contents"/>
850     <target name="maven-dist" depends="jar" description="Builds the POM files for a maven distribution, and copies these and the jars to the appropriate locations">
851                 <!-- Copy the jar files into the maven jar directory -->
852                 <!-- Same jars as for the main release, only lacking the datestamp -->
853                 <copy
854                         file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar"
855                         tofile="${mavendist.oap.dir}/jars/${jar.name}-${version.id}.jar" />
856                 <copy
857                         file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar"
858                         tofile="${mavendist.oap.dir}/jars/${jar.name}-contrib-${version.id}.jar" />
859                 <copy
860                         file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar"
861                         tofile="${mavendist.oap.dir}/jars/${jar.name}-scratchpad-${version.id}.jar" />
863                 <!-- TODO: Decide about source jars, and copy them if we have some -->
865                 <!-- Build the org.apache.poi poms -->
866                 <!-- Copy from the base file, substituting in the version and -->
867                 <!--  artificat, plus doing the core poi dependency as needed -->
869                 <!-- Build the main pom -->
870                 <copy 
871                         file="poi.pom" 
872                         tofile="${mavendist.oap.dir}/poms/${jar.name}-${version.id}.pom" 
873                 >
874                         <filterchain>
875                                 <replacetokens>
876                                         <token key="VERSION" value="${version.id}" />
877                                         <token key="ARTIFICAT" value="poi" />
878                                 </replacetokens>
879                                 <tokenfilter>
880                                         <filetokenizer/>
881                                         <replaceregex pattern="START_NON_MAIN.*END_NON_MAIN_DEPENDENCY" replace="No POI dependency on the main jar" flags="s" />
882                                 </tokenfilter>
883                         </filterchain>
884                 </copy>
885                 <!-- And the contrib pom -->
886                 <copy 
887                         file="poi.pom" 
888                         tofile="${mavendist.oap.dir}/poms/${jar.name}-contrib-${version.id}.pom" 
889                 >
890                         <filterchain>
891                                 <replacetokens>
892                                         <token key="VERSION" value="${version.id}" />
893                                         <token key="ARTIFICAT" value="poi-contrib" />
894                                 </replacetokens>
895                                 <tokenfilter>
896                                         <replaceregex pattern="..-- START_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
897                                         <replaceregex pattern="..-- END_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
898                                 </tokenfilter>
899                         </filterchain>
900                 </copy>
901                 <!-- And the scratchpad pom -->
902                 <copy 
903                         file="poi.pom" 
904                         tofile="${mavendist.oap.dir}/poms/${jar.name}-scratchpad-${version.id}.pom" 
905                 >
906                         <filterchain>
907                                 <replacetokens>
908                                         <token key="VERSION" value="${version.id}" />
909                                         <token key="ARTIFICAT" value="poi-scratchpad" />
910                                 </replacetokens>
911                                 <tokenfilter>
912                                         <replaceregex pattern="..-- START_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
913                                         <replaceregex pattern="..-- END_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
914                                 </tokenfilter>
915                         </filterchain>
916                 </copy>
918                 <!-- Build the poi => org.apache.poi redirect poms -->
919                 <!-- Copy from the base file, substituting in the version+artifact -->
920                 <copy 
921                         file="poi-redirect.pom" 
922                         tofile="${mavendist.poi.dir}/poms/${jar.name}-${version.id}.pom" 
923                 >
924                         <filterchain><replacetokens>
925                                 <token key="VERSION" value="${version.id}" />
926                                 <token key="ARTIFICAT" value="poi" />
927                         </replacetokens></filterchain>
928                 </copy>
929                 <copy 
930                         file="poi-redirect.pom" 
931                         tofile="${mavendist.poi.dir}/poms/${jar.name}-contrib-${version.id}.pom" 
932                 >
933                         <filterchain><replacetokens>
934                                 <token key="VERSION" value="${version.id}" />
935                                 <token key="ARTIFICAT" value="poi-contrib" />
936                         </replacetokens></filterchain>
937                 </copy>
938                 <copy 
939                         file="poi-redirect.pom" 
940                         tofile="${mavendist.poi.dir}/poms/${jar.name}-scratchpad-${version.id}.pom" 
941                 >
942                         <filterchain><replacetokens>
943                                 <token key="VERSION" value="${version.id}" />
944                                 <token key="ARTIFICAT" value="poi-scratchpad" />
945                         </replacetokens></filterchain>
946                 </copy>
948                 <!-- And that's it for maven -->
949         </target>
951     <target name="jar" depends="compile" description="Creates jar files for distribution">
952         <jar destfile="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar">
953                         <fileset dir="${main.output.dir}" />
954                         <fileset dir="legal/" />
955             <manifest>
956                 <attribute name="Built-By" value="${user.name}"/>
957                 <attribute name="Specification-Title" value="Apache POI"/>
958                 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
959                 <attribute name="Specification-Vendor" value="Apache"/>
960                 <attribute name="Implementation-Title" value="Apache POI"/>
961                 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
962                 <attribute name="Implementation-Vendor" value="Apache"/>
963             </manifest>        
964         </jar>
965         <jar destfile="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar">
966                         <fileset dir="${contrib.output.dir}" />
967                         <fileset dir="legal/" />
968             <manifest>
969                 <attribute name="Built-By" value="${user.name}"/>
970                 <attribute name="Specification-Title" value="Apache POI"/>
971                 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
972                 <attribute name="Specification-Vendor" value="Apache"/>
973                 <attribute name="Implementation-Title" value="Apache POI"/>
974                 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
975                 <attribute name="Implementation-Vendor" value="Apache"/>
976             </manifest>        
977         </jar>
978         <jar destfile="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar">
979                         <fileset dir="${scratchpad.output.dir}" />
980                         <fileset dir="legal/" />
981             <manifest>
982                 <attribute name="Built-By" value="${user.name}"/>
983                 <attribute name="Specification-Title" value="Apache POI"/>
984                 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
985                 <attribute name="Specification-Vendor" value="Apache"/>
986                 <attribute name="Implementation-Title" value="Apache POI"/>
987                 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
988                 <attribute name="Implementation-Vendor" value="Apache"/>
989             </manifest>        
990         </jar>
991     </target>
993   <target name="dist" depends="clean, fail-unless-tools-are-available, compile, site, jar"
994     description="Creates the entire distribution into build/dist, from scratch">
996         <property name="zipdir" value="${jar.name}-${version.id}" />
998     <zip destfile="${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.zip">
999       <zipfileset dir="legal/" prefix="${zipdir}" />
1000       <zipfileset dir="lib/" prefix="${zipdir}/lib" />
1001       <zipfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1002       <zipfileset file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1003       <zipfileset file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1004       <zipfileset file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1005     </zip>
1007     <zip destfile="${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.zip">
1008       <zipfileset dir="legal/" prefix="${zipdir}" />
1009       <zipfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1010       <zipfileset dir="." prefix="${zipdir}">
1011         <exclude name="build/**"/>
1012         <exclude name="scripts/**"/>
1013         <exclude name="*.ipr"/>
1014         <exclude name="*.iml"/>
1015         <exclude name="*.iws"/>
1016         <exclude name="*.swp"/>
1017       </zipfileset>
1018     </zip>
1020     <tar destfile="${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.tar.gz"
1021       compression="gzip">
1022       <tarfileset dir="legal/" prefix="${zipdir}" />
1023       <tarfileset dir="lib/" prefix="${zipdir}/lib" />
1024       <tarfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1025       <tarfileset file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1026       <tarfileset file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1027       <tarfileset file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1028     </tar>
1030     <tar destfile="${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.tar.gz"
1031       compression="gzip">
1032       <tarfileset dir="legal/" prefix="${zipdir}" />
1033       <tarfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1034       <tarfileset dir="." prefix="${zipdir}">
1035         <exclude name="build/**"/>
1036         <exclude name="scripts/**"/>
1037         <exclude name="*.ipr"/>
1038         <exclude name="*.iml"/>
1039         <exclude name="*.iws"/>
1040         <exclude name="*.swp"/>
1041       </tarfileset>
1042     </tar>
1044     <echo>Distribution located in build/dist</echo>
1045   </target>
1047   <target name="clean-compile" depends="clean, compile"/>
1049   <target name="clean-dist" depends="clean, dist"
1050     description="Cleans the build directory then creates a distribution"/>
1052   <target name="gump" depends="test, jar"/>
1056   <!-- Generates the Ant document type definition (DTD) -->
1057   <target name="dtd"
1058     description="Generates the Ant document type definition (DTD)">
1059     <antstructure output="ant.dtd"/>
1060   </target>
1065   <!-- Abort the build if JUnit is missing. -->
1066   <target name="fail-unless-junit-is-available" depends="init">
1067     <condition property="isAvailable.junit">
1068       <available classname="junit.framework.TestCase"/>
1069     </condition>
1070     <antcall target="fail-junit"/>
1071   </target>
1073   <target name="fail-junit" unless="isAvailable.junit">
1074     <echo>
1075       JUnit is not available. You must download JUnit from
1076       &lt;http://www.junit.org/&gt; and include the JAR file in your
1077       classpath.
1078     </echo> 
1079     <fail message="JUnit is not available."/>
1080   </target>
1082   <!-- Warn if JUnit is missing. -->
1083   <target name="warn-unless-junit-is-available" depends="init">
1084     <condition property="isAvailable.junit">
1085       <available classname="junit.framework.TestCase"/>
1086     </condition>
1087     <antcall target="warn-junit"/>
1088   </target>
1090   <target name="warn-junit" unless="isAvailable.junit">
1091     <echo>
1092       WARNING: Since JUnit is not available you might encounter failures
1093       subsequently. In order to avoid this you should download JUnit from
1094       &lt;http://www.junit.org/&gt; and include the JAR file in your
1095       classpath.
1096     </echo> 
1097   </target>
1101   <!-- Abort the build if JDepend is missing. -->
1102   <target name="fail-unless-jdepend-is-available" depends="init">
1103     <condition property="isAvailable.jdepend">
1104       <available classname="jdepend.framework.JDepend"/>
1105     </condition>
1106     <antcall target="fail-jdepend"/>
1107   </target>
1109   <target name="fail-jdepend" unless="isAvailable.jdepend">
1110     <echo>
1111       JDepend is not available. You must download JDepend from
1112       &lt;http://www.clarkware.com/software/JDepend.html&gt; and include the
1113       JAR file in your classpath.
1114     </echo> 
1115     <fail message="JDepend is not available."/>
1116   </target>
1120   <!-- Abort the build if an XSLT processor is missing. -->
1121   <target name="fail-unless-xslt-is-available" depends="init">
1122     <condition property="isAvailable.xslt">
1123       <available classname="javax.xml.transform.TransformerFactory"/>
1124     </condition>
1125     <antcall target="fail-xslt"/>
1126   </target>
1128   <target name="fail-xslt" unless="isAvailable.xslt">
1129     <echo>
1130       An XSLT processor is missing. You must download e.g. Xalan from
1131       &lt;http://xml.apache.org/xalan-j/&gt; and include the JAR file in your
1132       classpath.
1133     </echo> 
1134     <fail message="An XSLT processor is not available."/>
1135   </target>
1137   <!-- Warn if an XSLT processor is missing. -->
1138   <target name="warn-unless-xslt-is-available" depends="init">
1139     <condition property="isAvailable.xslt">
1140       <available classname="javax.xml.transform.TransformerFactory"/>
1141     </condition>
1142     <antcall target="warn-xslt"/>
1143   </target>
1145   <target name="warn-xslt" unless="isAvailable.xslt">
1146     <echo>
1147       WARNING: Since an XSLT processor is not available you might encounter
1148       failures subsequently. In order to avoid this you should download
1149       e.g. Xalan from &lt;http://xml.apache.org/xalan-j/&gt; and include the
1150       JAR file in your classpath.
1151     </echo> 
1152   </target>
1156   <!-- Aborts the build if any of the required tools are missing. -->
1157   <target name="fail-unless-tools-are-available"
1158     depends="fail-unless-junit-is-available, fail-unless-junit-is-available,
1159     fail-unless-jdepend-is-available"/>
1163   <!-- Runs jdepend to produce a report about package dependencies -->
1164   <target name="jdepend" depends="fail-unless-jdepend-is-available"
1165     description="Runs jdepend to produce a report about package dependencies">
1166     <jdepend outputfile="${jdepend.report.dir}/jdepend.xml" format="xml">
1167       <classespath>
1168         <pathelement location="${main.output.dir}"/>
1169         <pathelement location="${contrib.output.dir}"/>
1170         <pathelement location="${scratchpad.output.dir}"/>
1171       </classespath>
1172       <classpath>
1173         <path refid="main.classpath"/>
1174         <path refid="contrib.classpath"/>
1175         <path refid="scratchpad.classpath"/>
1176       </classpath>
1177     </jdepend>
1179     <style basedir="${jdepend.report.dir}"
1180       in="${jdepend.report.dir}/jdepend.xml"
1181       out="${jdepend.report.out.dir}/index.html"
1182       style="jdepend.xsl"/>
1183   </target>
1185 </project>
1187 <!-- Keep this comment at the end of the file
1188 Local variables:
1189 mode: xml
1190 sgml-omittag:nil
1191 sgml-shorttag:nil
1192 sgml-namecase-general:nil
1193 sgml-general-insert-case:lower
1194 sgml-minimize-attributes:nil
1195 sgml-always-quote-attributes:t
1196 sgml-indent-step:2
1197 sgml-indent-data:t
1198 sgml-parent-document:nil
1199 sgml-exposed-tags:nil
1200 sgml-local-catalogs:nil
1201 sgml-local-ecat-files:nil
1202 End: