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
20 <!DOCTYPE project PUBLIC "-//Ant//Project 1.5//EN" "ant.dtd">
23 POI Build System. Written by:
25 Glen Stampoultzis glens at apache.org
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:
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
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
55 Convert book.xml files to a sitemap.
58 <project name="POI Build" default="help" basedir=".">
61 The POI project Ant build.
64 <property environment="env"/>
66 <property name="repository" value="http://www.ibiblio.org/maven"/>
67 <property name="forrest.home" value="${env.FORREST_HOME}"/>
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="ooxml.lib" location="ooxml-lib"/>
78 <property name="main.reports.test" location="build/test-results"/>
79 <property name="main.jar1.dir" location="${main.lib}/commons-logging-1.1.jar"/>
80 <property name="main.jar1.url" value="${repository}/commons-logging/jars/commons-logging-1.1.jar"/>
81 <property name="main.jar2.dir" location="${main.lib}/log4j-1.2.13.jar"/>
82 <property name="main.jar2.url" value="${repository}/log4j/jars/log4j-1.2.13.jar"/>
83 <property name="main.testokfile" location="build/main-testokfile.txt"/>
85 <property name="junit.jar1.dir" location="${main.lib}/junit-3.8.1.jar"/>
86 <property name="junit.jar1.url" value="${repository}/junit/jars/junit-3.8.1.jar"/>
89 <property name="scratchpad.src" location="src/scratchpad/src"/>
90 <property name="scratchpad.src.test" location="src/scratchpad/testcases"/>
91 <property name="scratchpad.lib" location="src/scratchpad/lib"/>
92 <property name="scratchpad.reports.test" location="build/scratchpad-test-results"/>
93 <property name="scratchpad.output.dir" location="build/scratchpad-classes"/>
94 <property name="scratchpad.output.test.dir" location="build/scratchpad-test-classes"/>
95 <property name="scratchpad.testokfile" location="build/scratchpad-testokfile.txt"/>
97 <!-- Contributed software: -->
98 <property name="contrib.src" location="src/contrib/src"/>
99 <property name="contrib.src.test" location="src/contrib/testcases"/>
100 <property name="contrib.lib" location="src/contrib/lib"/>
101 <property name="contrib.reports.test" location="build/contrib-test-results"/>
102 <property name="contrib.output.dir" location="build/contrib-classes"/>
103 <property name="contrib.output.test.dir" location="build/contrib-test-classes"/>
104 <property name="contrib.jar1.dir" location="${contrib.lib}/commons-beanutils-1.7.0.jar"/>
105 <property name="contrib.jar1.url" value="${repository}/commons-beanutils/jars/commons-beanutils-1.7.0.jar"/>
106 <property name="contrib.jar2.dir" location="${contrib.lib}/commons-collections-3.2.jar"/>
107 <property name="contrib.jar2.url" value="${repository}/commons-collections/jars/commons-collections-3.2.jar"/>
108 <property name="contrib.jar3.dir" location="${contrib.lib}/commons-lang-2.1.jar"/>
109 <property name="contrib.jar3.url" value="${repository}/commons-lang/jars/commons-lang-2.1.jar"/>
110 <property name="contrib.testokfile" location="build/contrib-testokfile.txt"/>
113 <property name="examples.src" location="src/examples/src"/>
114 <property name="examples.src.test" location="src/examples/testcases"/>
115 <property name="examples.lib" location="src/examples/lib"/>
116 <property name="examples.reports.test" location="build/examples-test-results"/>
117 <property name="examples.output.dir" location="build/examples-classes"/>
118 <property name="examples.output.test.dir" location="build/examples-test-classes"/>
119 <property name="examples.jar1.dir" location="${examples.lib}/commons-beanutils-1.7.0.jar"/>
120 <property name="examples.jar1.url" value="${repository}/commons-beanutils/jars/commons-beanutils-1.7.0.jar"/>
121 <property name="examples.jar2.dir" location="${examples.lib}/commons-collections-3.2.jar"/>
122 <property name="examples.jar2.url" value="${repository}/commons-collections/jars/commons-collections-3.2.jar"/>
123 <property name="examples.jar3.dir" location="${examples.lib}/commons-lang-2.1.jar"/>
124 <property name="examples.jar3.url" value="${repository}/commons-lang/jars/commons-lang-2.1.jar"/>
125 <property name="examples.testokfile" location="build/examples-testokfile.txt"/>
127 <!-- Experimental OOXML support: -->
128 <property name="ooxml.src" location="src/scratchpad/ooxml-src"/>
129 <property name="ooxml.src.test" location="src/scratchpad/ooxml-testcases"/>
130 <property name="ooxml.reports.test" location="build/ooxml-test-results"/>
131 <property name="ooxml.output.dir" location="build/ooxml-classes"/>
132 <property name="ooxml.output.test.dir" location="build/ooxml-test-classes"/>
133 <property name="ooxml.testokfile" location="build/ooxml-testokfile.txt"/>
135 <property name="ooxml.jar1.dir" location="${ooxml.lib}/dom4j-1.6.1.jar"/>
136 <property name="ooxml.jar1.url" value="${repository}/dom4j/jars/dom4j-1.6.1.jar"/>
137 <property name="ooxml.jar2.dir" location="${ooxml.lib}/jaxen-1.1.jar"/>
138 <property name="ooxml.jar2.url" value="${repository}/jaxen/jars/jaxen-1.1.jar"/>
139 <property name="ooxml.jar3.dir" location="${ooxml.lib}/xmlbeans-2.3.0.jar"/>
140 <property name="ooxml.jar3.url" value="${repository}/org.apache.xmlbeans/jars/xmlbeans-2.3.0.jar"/>
141 <property name="ooxml.jar4.dir" location="${ooxml.lib}/jsr173_1.0_api.jar"/>
142 <property name="ooxml.jar4.url" value="${repository}/xmlbeans/jars/jsr173_1.0_api.jar"/>
143 <!-- No official release of openxml4j yet -->
144 <property name="ooxml.jar5.dir" location="${ooxml.lib}/openxml4j-bin-alpha-080124.jar"/>
145 <property name="ooxml.jar5.url" value="http://people.apache.org/~nick/openxml4j-bin-prealpha-071224.jar"/>
147 <!-- See http://www.ecma-international.org/publications/standards/Ecma-376.htm -->
148 <!-- "Copy these file(s), free of charge" -->
149 <property name="ooxml.xsds.ozip" location="${ooxml.lib}/OfficeOpenXML-Part4.zip"/>
150 <property name="ooxml.xsds.izip" location="${ooxml.lib}/OfficeOpenXML-XMLSchema.zip"/>
151 <property name="ooxml.xsds.url" value="http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%20Part%204%20(DOCX).zip" />
152 <property name="ooxml.xsds.jar" location="${ooxml.lib}/ooxml-schemas.jar"/>
154 <property name="build.site" location="build/tmp/site/build/site"/>
155 <property name="build.site.src" location="build/tmp/site"/>
156 <property name="junit.report.dir" location="${build.site}/junit"/>
157 <property name="jdepend.report.dir" location="${build.site}/jdepend"/>
158 <property name="jdepend.report.out.dir" location="${build.site.src}/src/documentation/content/jdepend"/>
159 <property name="apidocs.report.dir" location="${build.site}/apidocs"/>
160 <property name="changelog.file" location="${build.site}/changelog.html"/>
161 <property name="dist.dir" location="build/dist"/>
162 <property name="mavendist.dir" location="build/maven-dist"/>
163 <property name="mavendist.poi.dir" location="build/maven-dist/poi"/>
164 <property name="mavendist.oap.dir" location="build/maven-dist/org.apache.poi"/>
165 <property name="jar.name" value="poi"/>
166 <property name="version.id" value="3.0.3-alpha1"/>
167 <property name="halt.on.test.failure" value="true"/>
168 <property name="jdk.version.source" value="1.3"
169 description="JDK version of source code"/>
170 <property name="jdk.version.class" value="1.3"
171 description="JDK version of generated class files"/>
174 <path id="main.classpath">
175 <pathelement location="${main.jar1.dir}"/>
176 <pathelement location="${main.jar2.dir}"/>
177 <pathelement location="${main.resource1.dir}"/>
180 <path id="scratchpad.classpath">
181 <path refid="main.classpath"/>
182 <pathelement location="${main.output.dir}"/>
185 <path id="contrib.classpath">
186 <path refid="main.classpath"/>
187 <pathelement location="${contrib.jar1.dir}"/>
188 <pathelement location="${contrib.jar2.dir}"/>
189 <pathelement location="${contrib.jar3.dir}"/>
190 <pathelement location="${main.output.dir}"/>
191 <pathelement location="${main.output.test.dir}"/>
192 <pathelement location="${scratchpad.output.dir}"/>
193 <pathelement location="${scratchpad.output.test.dir}"/>
194 <pathelement location="${contrib.output.dir}"/>
195 <pathelement location="${contrib.output.test.dir}"/>
198 <path id="ooxml.classpath">
199 <path refid="main.classpath"/>
200 <path refid="scratchpad.classpath"/>
201 <fileset dir="${ooxml.lib}">
202 <include name="*.jar" />
207 <path id="examples.classpath">
208 <path refid="main.classpath"/>
209 <pathelement location="${main.output.dir}"/>
214 <!-- Prints POI's Ant usage help -->
215 <target name="help" description="Prints POI's Ant usage help">
217 - Execute "ant -projecthelp" to view a listing of the main build
219 - Execute "ant help-properties" to view a listing of some properties
220 controlling the build process.
226 <target name="help-properties"
227 description="Prints a listing of build controlling properties">
229 The following properties control the build process:
231 -Ddisconnected="true": Do not execute any targets that require an online
232 connection to the Internet.
233 -Dtestcase=org.apache.poi.xxx.xxx : for the single-test target, specify
236 WARNING: This list is not exhaustive.
242 <target name="with.clover" if="clover.present">
243 <taskdef resource="clovertasks"/>
244 <clover-setup initString="mycoverage.db"/>
247 <target name="clover.html" depends="with.clover" if="clover.present">
248 <echo>Generating clover report</echo>
250 <current outfile="build/tmp/site/build/site/clover_html">
251 <format type="html"/>
256 <target name="init" depends="check-jars,fetch-jars">
259 <format property="tstamp.year" pattern="yyyy"/>
262 <available resource="clovertasks" property="clover.present"/>
263 <antcall target="with.clover"/>
266 <mkdir dir="build/non-ant-classes"/>
267 <mkdir dir="${main.output.dir}"/>
268 <mkdir dir="${scratchpad.output.dir}"/>
269 <mkdir dir="${contrib.output.dir}"/>
270 <mkdir dir="${examples.output.dir}"/>
271 <mkdir dir="${ooxml.output.dir}"/>
272 <mkdir dir="${main.output.test.dir}"/>
273 <mkdir dir="${contrib.output.test.dir}"/>
274 <mkdir dir="${scratchpad.output.test.dir}"/>
275 <mkdir dir="${ooxml.output.test.dir}"/>
276 <mkdir dir="${main.reports.test}"/>
277 <mkdir dir="${scratchpad.reports.test}"/>
278 <mkdir dir="${contrib.reports.test}"/>
279 <mkdir dir="${ooxml.reports.test}"/>
280 <mkdir dir="${junit.report.dir}"/>
281 <mkdir dir="${jdepend.report.dir}"/>
282 <mkdir dir="${jdepend.report.out.dir}"/>
283 <mkdir dir="${apidocs.report.dir}"/>
284 <mkdir dir="${dist.dir}"/>
285 <mkdir dir="${build.site.src}/${main.documentation}"/>
287 <mkdir dir="${mavendist.dir}"/>
288 <mkdir dir="${mavendist.poi.dir}"/>
289 <mkdir dir="${mavendist.poi.dir}/poms"/>
290 <mkdir dir="${mavendist.oap.dir}"/>
291 <mkdir dir="${mavendist.oap.dir}/jars"/>
292 <mkdir dir="${mavendist.oap.dir}/poms"/>
294 <copy todir="${build.site.src}/${main.documentation}">
295 <fileset dir="${main.documentation}"/>
297 <copy file="forrest.properties" tofile="${build.site.src}/forrest.properties"/>
300 <target name="clean">
301 <delete dir="build"/>
304 <target name="check-jars">
305 <condition property="jars.present">
308 <available file="${main.jar1.dir}"/>
309 <available file="${main.jar2.dir}"/>
310 <available file="${contrib.jar1.dir}"/>
311 <available file="${contrib.jar2.dir}"/>
312 <available file="${contrib.jar3.dir}"/>
313 <available file="${junit.jar1.dir}"/>
314 <available file="${ooxml.jar1.dir}"/>
315 <available file="${ooxml.jar2.dir}"/>
316 <available file="${ooxml.jar3.dir}"/>
317 <available file="${ooxml.jar4.dir}"/>
318 <available file="${ooxml.jar5.dir}"/>
320 <isset property="disconnected"/>
325 <target name="fetch-jars" unless="jars.present"
326 description="Fetches needed JAR files from the Internet">
327 <get src="${main.jar1.url}" dest="${main.jar1.dir}"/>
328 <get src="${main.jar2.url}" dest="${main.jar2.dir}"/>
329 <get src="${contrib.jar1.url}" dest="${contrib.jar1.dir}"/>
330 <get src="${contrib.jar2.url}" dest="${contrib.jar2.dir}"/>
331 <get src="${contrib.jar3.url}" dest="${contrib.jar3.dir}"/>
332 <get src="${junit.jar1.url}" dest="${junit.jar1.dir}"/>
334 <get src="${ooxml.jar1.url}" dest="${ooxml.jar1.dir}"/>
335 <get src="${ooxml.jar2.url}" dest="${ooxml.jar2.dir}"/>
336 <get src="${ooxml.jar3.url}" dest="${ooxml.jar3.dir}"/>
337 <get src="${ooxml.jar4.url}" dest="${ooxml.jar4.dir}"/>
338 <get src="${ooxml.jar5.url}" dest="${ooxml.jar5.dir}"/>
341 <target name="check-ooxml-xsds">
342 <condition property="ooxml-xsds.present">
345 <available file="${ooxml.xsds.izip}"/>
347 <isset property="disconnected"/>
351 <target name="fetch-ooxml-xsds" unless="ooxml-xsds.present"
352 description="Fetches needed OOXML xsd files from the Internet">
353 <get src="${ooxml.xsds.url}" dest="${ooxml.xsds.ozip}"/>
354 <unzip src="${ooxml.xsds.ozip}" dest="${ooxml.lib}">
356 <include name="OfficeOpenXML-XMLSchema.zip" />
360 <target name="check-compiled-ooxml-xsds">
361 <condition property="ooxml-compiled-xsds.present">
364 <available file="${ooxml.xsds.jar}"/>
366 <isset property="disconnected"/>
370 <target name="compile-ooxml-xsds" unless="ooxml-compiled-xsds.present"
371 depends="check-jars,fetch-jars,check-ooxml-xsds,fetch-ooxml-xsds,check-compiled-ooxml-xsds"
372 description="Unpacks the OOXML xsd files, and compiles them into XmlBeans">
373 <taskdef name="xmlbean"
374 classname="org.apache.xmlbeans.impl.tool.XMLBean"
375 classpath="${ooxml.jar3.dir}:${ooxml.jar4.dir}" />
377 <unzip src="${ooxml.xsds.izip}" dest="build/ooxml-xsds/" />
379 schema="build/ooxml-xsds/"
380 schema="build/ooxml-xsds/sml-workbook.xsd"
383 schema="build/ooxml-xsds/"
384 destfile="${ooxml.xsds.jar}"
388 memoryMaximumSize="512m"
390 <classpath refid="ooxml.classpath"/>
394 <target name="compile" depends="init, compile-main, compile-scratchpad,
395 compile-contrib, compile-examples"
396 description="Compiles the POI main classes, scratchpad, contrib, and examples"/>
398 <target name="compile-main" depends="fail-unless-xslt-is-available">
399 <copy todir="${main.output.dir}">
400 <fileset dir="${main.resource1.dir}"/>
402 <javac target="${jdk.version.class}" source="${jdk.version.source}"
403 failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes"
404 srcdir="${main.src}">
405 <classpath refid="main.classpath"/>
407 <javac target="${jdk.version.class}" source="${jdk.version.source}"
408 failonerror="true" destdir="${main.output.test.dir}" debug="on"
409 fork="yes" srcdir="${main.src.test}">
411 <path refid="main.classpath"/>
412 <pathelement location="${main.output.dir}"/>
413 <pathelement location="${junit.jar1.dir}"/>
418 <target name="compile-scratchpad" depends="init,compile-main">
419 <javac target="${jdk.version.class}" source="${jdk.version.source}"
420 failonerror="true" destdir="${scratchpad.output.dir}" debug="on"
421 fork="yes" srcdir="${scratchpad.src}">
422 <classpath refid="scratchpad.classpath"/>
424 <javac target="${jdk.version.class}" source="${jdk.version.source}"
425 failonerror="true" destdir="${scratchpad.output.test.dir}" debug="on"
426 fork="yes" srcdir="${scratchpad.src.test}">
428 <path refid="scratchpad.classpath"/>
429 <pathelement location="${scratchpad.output.dir}"/>
430 <pathelement location="${junit.jar1.dir}"/>
434 <!-- Copy HSLF Resources over -->
435 <property name="hslf.data" value="org/apache/poi/hslf/data" />
436 <mkdir dir="${scratchpad.output.dir}/${hslf.data}" />
437 <copy todir="${scratchpad.output.dir}/${hslf.data}">
438 <fileset dir="${scratchpad.src}/${hslf.data}">
439 <include name="*.ppt" />
443 <!-- Copy HDGF Resources over -->
444 <property name="hdgf.chunks" value="org/apache/poi/hdgf/chunks" />
445 <copy todir="${scratchpad.output.dir}/${hdgf.chunks}">
446 <fileset dir="${scratchpad.src}/${hdgf.chunks}">
447 <include name="*.tbl" />
452 <target name="compile-contrib" depends="init">
453 <javac target="${jdk.version.class}" source="${jdk.version.source}"
454 failonerror="true" destdir="${contrib.output.dir}" debug="on" fork="yes"
455 srcdir="${contrib.src}">
456 <classpath refid="contrib.classpath"/>
458 <javac target="${jdk.version.class}" source="${jdk.version.source}"
459 failonerror="true" destdir="${contrib.output.test.dir}" debug="on"
460 fork="yes" srcdir="${contrib.src.test}">
462 <path refid="contrib.classpath"/>
463 <pathelement location="${contrib.output.dir}"/>
464 <pathelement location="${junit.jar1.dir}"/>
469 <target name="compile-examples" depends="init">
470 <javac target="${jdk.version.class}" source="${jdk.version.source}"
471 destdir="${examples.output.dir}" debug="on" srcdir="${examples.src}">
472 <classpath refid="examples.classpath"/>
476 <target name="compile-ooxml" depends="init, check-ooxml-xsds, fetch-ooxml-xsds, compile-ooxml-xsds, compile-main">
477 <!-- openxml4j requires java 1.5, so so must we, for now -->
478 <javac target="1.5" source="1.5"
479 destdir="${ooxml.output.dir}" debug="on" srcdir="${ooxml.src}">
480 <classpath refid="ooxml.classpath"/>
483 <javac target="1.5" source="1.5"
484 failonerror="true" destdir="${ooxml.output.test.dir}" debug="on"
485 fork="yes" srcdir="${ooxml.src.test}">
487 <path refid="ooxml.classpath"/>
488 <pathelement location="${ooxml.output.dir}"/>
489 <pathelement location="${junit.jar1.dir}"/>
494 <target name="test" depends="test-main,test-scratchpad,test-contrib"
495 description="Tests main, contrib and scratchpad"/>
497 <target name="-test-main-check">
498 <uptodate property="main.test.notRequired" targetfile="${main.testokfile}">
499 <srcfiles dir="${main.src}"/>
500 <srcfiles dir="${main.src.test}"/>
504 <path id="test.classpath">
505 <path refid="main.classpath"/>
506 <pathelement location="${main.output.dir}"/>
507 <pathelement location="${main.output.test.dir}"/>
508 <pathelement location="${junit.jar1.dir}"/>
511 <target name="test-main" unless="main.test.notRequired"
512 depends="compile-main, -test-main-check, fail-unless-junit-is-available">
513 <junit fork="no" printsummary="yes" haltonfailure="${halt.on.test.failure}"
514 failureproperty="main.test.failed" showoutput="true">
515 <classpath refid="test.classpath"/>
516 <sysproperty key="HSSF.testdata.path"
517 file="${main.src.test}/org/apache/poi/hssf/data"/>
518 <sysproperty key="HSLF.testdata.path"
519 file="${main.src.test}/org/apache/poi/hslf/data"/>
520 <sysproperty key="HWPF.testdata.path"
521 file="${main.src.test}/org/apache/poi/hwpf/data"/>
522 <sysproperty key="HPSF.testdata.path"
523 file="${main.src.test}/org/apache/poi/hpsf/data"/>
524 <sysproperty key="POIFS.testdata.path"
525 file="${main.src.test}/org/apache/poi/poifs/data"/>
526 <sysproperty key="java.awt.headless" value="true"/>
527 <formatter type="plain"/>
528 <formatter type="xml"/>
529 <batchtest todir="${main.reports.test}">
530 <fileset dir="${main.src.test}">
531 <include name="**/Test*.java"/>
532 <exclude name="**/All*Tests.java"/>
533 <exclude name="**/TestUnfixedBugs.java"/>
534 <exclude name="**/TestcaseRecordInputStream.java"/>
538 <delete file="${main.testokfile}"/>
539 <antcall target="-test-main-write-testfile"/>
542 <target name="test-fail" depends="compile-main,
543 fail-unless-junit-is-available"
544 description="run tests that are known to fail">
545 <junit printsummary="yes" showoutput="true" filtertrace="no"
546 haltonfailure="false">
547 <classpath refid="test.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}"/>
555 <sysproperty key="HSSF.testdata.path"
556 file="${main.src.test}/org/apache/poi/hssf/data"/>
557 <sysproperty key="HPSF.testdata.path"
558 file="${main.src.test}/org/apache/poi/hpsf/data"/>
559 <sysproperty key="HWPF.testdata.path"
560 file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
561 <sysproperty key="POIFS.testdata.path"
562 file="${main.src.test}/org/apache/poi/poifs/data"/>
563 <sysproperty key="java.awt.headless" value="true"/>
564 <formatter type="plain" usefile="no"/>
565 <batchtest todir="${main.reports.test}">
566 <fileset dir="${main.src.test}">
567 <include name="**/TestEmptyDocument.java"/>
568 <include name="**/TestUnfixedBugs.java"/>
576 <target name="single-test" depends="-test-property-check,compile-main" description="Runs a single test case specified with -Dtestcase=classname">
577 <junit printsummary="yes" showoutput="true" filtertrace="no" haltonfailure="false" >
578 <classpath refid="test.classpath"/>
580 <path refid="test.classpath"/>
581 <pathelement location="${main.output.dir}"/>
582 <pathelement location="${scratchpad.output.dir}"/>
583 <pathelement location="${scratchpad.output.test.dir}"/>
584 <pathelement location="${junit.jar1.dir}"/>
586 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
587 <sysproperty key="HPSF.testdata.path" file="${main.src.test}/org/apache/poi/hpsf/data"/>
588 <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
589 <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
590 <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
591 <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
592 <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/>
593 <sysproperty key="java.awt.headless" value="true"/>
594 <formatter type="plain" usefile="no"/>
595 <formatter type="xml"/>
596 <test name="${testcase}"/>
600 <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." >
601 <echo>Waiting for debugger on port 5001</echo>
602 <junit printsummary="no" showoutput="true" filtertrace="no" fork="yes" haltonfailure="${halt.on.test.failure}" failureproperty="main.test.failed">
603 <jvmarg value="-Xdebug"/>
604 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=y"/>
605 <sysproperty key="java.compiler" value="NONE"/>
606 <classpath refid="test.classpath"/>
607 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
608 <sysproperty key="HPSF.testdata.path" file="${main.src.test}/org/apache/poi/hpsf/data"/>
609 <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/>
610 <sysproperty key="java.awt.headless" value="true"/>
611 <formatter type="plain" usefile="no"/>
612 <test name="${testcase}"/>
616 <target name="-test-property-check" unless="testcase">
617 <echo message="Please use -Dtestcase=org.your.testcase to run a single test"/>
621 <target name="-test-main-write-testfile" unless="main.test.failed">
622 <echo file="${main.testokfile}" append="false" message="testok"/>
625 <target name="-test-scratchpad-check">
626 <uptodate property="scratchpad.test.notRequired" targetfile="${scratchpad.testokfile}">
627 <srcfiles dir="${scratchpad.src}"/>
628 <srcfiles dir="${scratchpad.src.test}"/>
632 <target name="test-scratchpad" depends="compile-main,compile-scratchpad,-test-scratchpad-check" unless="scratchpad.test.notRequired">
633 <junit printsummary="yes" fork="no" haltonfailure="${halt.on.test.failure}" failureproperty="scratchpad.test.failed">
635 <path refid="scratchpad.classpath"/>
636 <pathelement location="${main.output.dir}"/>
637 <pathelement location="${scratchpad.output.dir}"/>
638 <pathelement location="${scratchpad.output.test.dir}"/>
639 <pathelement location="${junit.jar1.dir}"/>
641 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
642 <sysproperty key="HPSF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hpsf/data"/>
643 <sysproperty key="HDF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdf/data"/>
644 <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
645 <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
646 <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
647 <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
648 <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/>
649 <sysproperty key="java.awt.headless" value="true"/>
650 <formatter type="plain"/>
651 <formatter type="xml"/>
652 <batchtest todir="${scratchpad.reports.test}">
653 <fileset dir="${scratchpad.src.test}">
654 <include name="**/Test*.java"/>
655 <exclude name="**/AllTests.java"/>
659 <delete file="${scratchpad.testokfile}"/>
660 <antcall target="-test-scratchpad-write-testfile"/>
663 <target name="-test-scratchpad-write-testfile" unless="scratchpad.test.failed">
664 <echo file="${scratchpad.testokfile}" append="false" message="testok"/>
667 <target name="single-scratchpad-test" depends="compile-scratchpad,-test-property-check" description="Runs a single test case specified with -Dtestcase=classname">
668 <junit printsummary="yes" showoutput="true" filtertrace="no" haltonfailure="false" >
669 <classpath refid="test.classpath"/>
671 <path refid="scratchpad.classpath"/>
672 <pathelement location="${main.output.dir}"/>
673 <pathelement location="${scratchpad.output.dir}"/>
674 <pathelement location="${scratchpad.output.test.dir}"/>
675 <pathelement location="${junit.jar1.dir}"/>
677 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
678 <sysproperty key="HPSF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hpsf/data"/>
679 <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
680 <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
681 <sysproperty key="HSMF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hsmf/data"/>
682 <sysproperty key="HDGF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hdgf/data"/>
683 <sysproperty key="POIFS.testdata.path" file="${main.src.test}/org/apache/poi/poifs/data"/>
684 <sysproperty key="java.awt.headless" value="true"/>
685 <sysproperty key="java.awt.headless" value="true"/>
686 <formatter type="plain" usefile="no"/>
687 <formatter type="xml"/>
688 <test name="${testcase}"/>
692 <target name="-test-contrib-check">
693 <uptodate property="contrib.test.notRequired" targetfile="${contrib.testokfile}">
694 <srcfiles dir="${contrib.src}"/>
695 <srcfiles dir="${contrib.src.test}"/>
699 <target name="test-contrib" depends="compile-main,compile-contrib,-test-contrib-check" unless="contrib.test.notRequired">
700 <junit printsummary="yes" fork="no" haltonfailure="${halt.on.test.failure}" failureproperty="contrib.test.failed">
702 <path refid="contrib.classpath"/>
703 <pathelement location="${main.output.dir}"/>
704 <pathelement location="${contrib.output.dir}"/>
705 <pathelement location="${contrib.output.test.dir}"/>
706 <pathelement location="${junit.jar1.dir}"/>
708 <sysproperty key="HSSF.testdata.path" file="${contrib.src.test}/org/apache/poi/hssf/data"/>
709 <sysproperty key="HPSF.testdata.path" file="${contrib.src.test}/org/apache/poi/hpsf/data"/>
710 <sysproperty key="java.awt.headless" value="true"/>
711 <formatter type="plain"/>
712 <formatter type="xml"/>
713 <batchtest todir="${contrib.reports.test}">
714 <fileset dir="${contrib.src.test}">
715 <include name="**/Test*.java"/>
716 <exclude name="**/AllTests.java"/>
720 <delete file="${contrib.testokfile}"/>
721 <antcall target="-test-contrib-write-testfile"/>
724 <target name="-test-contrib-write-testfile" unless="contrib.test.failed">
725 <echo file="${contrib.testokfile}" append="false" message="testok"/>
728 <target name="-test-ooxml-check">
729 <uptodate property="ooxml.test.notRequired" targetfile="${ooxml.testokfile}">
730 <srcfiles dir="${ooxml.src}"/>
731 <srcfiles dir="${ooxml.src.test}"/>
735 <target name="test-ooxml" depends="compile-main,compile-ooxml,-test-ooxml-check" unless="ooxml.test.notRequired">
736 <junit printsummary="yes" fork="no" haltonfailure="${halt.on.test.failure}" failureproperty="ooxml.test.failed">
738 <path refid="ooxml.classpath"/>
739 <pathelement location="${main.output.dir}"/>
740 <pathelement location="${ooxml.output.dir}"/>
741 <pathelement location="${ooxml.output.test.dir}"/>
742 <pathelement location="${junit.jar1.dir}"/>
744 <sysproperty key="HSSF.testdata.path" file="${main.src.test}/org/apache/poi/hssf/data"/>
745 <sysproperty key="HWPF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hwpf/data"/>
746 <sysproperty key="HSLF.testdata.path" file="${scratchpad.src.test}/org/apache/poi/hslf/data"/>
747 <sysproperty key="java.awt.headless" value="true"/>
748 <formatter type="plain"/>
749 <formatter type="xml"/>
750 <batchtest todir="${ooxml.reports.test}">
751 <fileset dir="${ooxml.src.test}">
752 <include name="**/Test*.java"/>
753 <exclude name="**/AllTests.java"/>
757 <delete file="${ooxml.testokfile}"/>
758 <antcall target="-test-ooxml-write-testfile"/>
761 <target name="-test-ooxml-write-testfile" unless="ooxml.test.failed">
762 <echo file="${ooxml.testokfile}" append="false" message="testok"/>
765 <target name="-check-docs">
766 <uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html">
767 <srcfiles dir="${build.site.src}"/>
771 <target name="-check-forrest-installed" unless="env.FORREST_HOME">
772 <echo>Please install Apache Forrest (see
773 <http://xml.apache.org/forrest/index.html>) and set the
774 FORREST_HOME environment variable!</echo>
775 <fail message="Apache Forrest is not installed."/>
778 <!-- <target name="check-docs">-->
779 <!-- <uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html" >-->
780 <!-- <srcfiles dir= "${build.site.src}"/>-->
784 <target name="docs" depends="init, -check-forrest-installed, -check-docs"
785 unless="main.docs.notRequired" description="Builds the POI website">
787 <mkdir dir="${build.site.src}/src/documentation/content/apidocs"/>
788 <copy todir="${build.site.src}/src/documentation/content/apidocs">
789 <fileset dir="${apidocs.report.dir}"/>
792 tofile="${build.site.src}/src/documentation/content/jdepend.ehtml"
793 file="${jdepend.report.dir}/index.html" failonerror="false"/>
794 <mkdir dir="${build.site.src}/src/documentation/content/junit"/>
795 <copy todir="${build.site.src}/src/documentation/content/junit">
796 <fileset dir="${junit.report.dir}"/>
800 file="${build.site.src}/src/documentation/content/xdocs/status.xml"
801 tofile="${build.site.src}/status.xml"/>
803 <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site">
804 <property name="project.home" location="${build.site.src}"/>
807 <echo>Broken links:</echo>
808 <echo file="${build.site}/../tmp/brokenlinks.txt"/>
811 <fileset dir="${build.site}"/>
815 <!-- Checks whether reports are required to be run. If nothing has changed then they dont. -->
816 <target name="-check-reports">
817 <condition property="reports.notRequired">
819 <equals arg1="${main.test.notRequired}" arg2="true"/>
820 <equals arg1="${scratchpad.test.notRequired}" arg2="true"/>
821 <equals arg1="${contrib.test.notRequired}" arg2="true"/>
828 <!-- Generates a log of the latest changes in the CVS repository. -->
829 <target name="cvschangelog" unless="disconnected"
830 depends="fail-unless-xslt-is-available"
831 description="Generates a CVS change log report">
832 <antcall target="cvs-rsh-warning"/>
833 <cvschangelog destfile="${changelog.file}" daysinpast="30"/>
835 <style in="${changelog.file}"
836 out="${build.site.src}/src/documentation/content/changelog.html"
837 style="changelog.xsl">
838 <param name="title" expression="POI Change Log"/>
839 <param name="module" expression="jakarta-poi"/>
840 <param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
844 <target name="cvs-rsh-warning" unless="env.CVS_RSH">
846 WARNING: The environment variable CVS_RSH is not set. If you cannot
847 access the CVS repository this could be one of the reasons for the
854 <!-- Creates reports and API documentation -->
855 <target name="reports" unless="reports.notRequired" depends="-check-reports,
856 fail-unless-xslt-is-available, fail-unless-junit-is-available,
857 fail-unless-jdepend-is-available, test-ignore-failures, junitreport,
858 jdepend, cvschangelog, javadocs, clover.html"
859 description="Creates various reports and the API documentation">
864 <!-- Runs all JUnit tests without aborting if one of the tests fails. -->
865 <target name="test-ignore-failures" depends="init">
866 <antcall target="test">
867 <param name="halt.on.test.failure" value="false"/>
873 <!-- Produces a report of the JUnit test results -->
874 <target name="junitreport"
875 depends="fail-unless-xslt-is-available, test-ignore-failures"
876 description="Produces a report of the JUnit test results">
877 <junitreport todir="${junit.report.dir}">
878 <fileset dir="${main.reports.test}">
879 <include name="TEST-*.xml"/>
881 <fileset dir="${scratchpad.reports.test}">
882 <include name="TEST-*.xml"/>
884 <fileset dir="${contrib.reports.test}">
885 <include name="TEST-*.xml"/>
887 <report format="frames" todir="${junit.report.dir}"/>
893 <!-- Generates the API documentation. -->
894 <target name="javadocs" depends="init, warn-unless-junit-is-available,
895 warn-unless-xslt-is-available"
896 description="Generates the API documentation">
897 <javadoc verbose="false" author="true" destdir="${apidocs.report.dir}"
898 windowtitle="POI API Documentation" use="true" version="true">
900 <packageset dir="${main.src}" defaultexcludes="yes">
901 <include name="org/apache/poi/**"/>
903 <packageset dir="${scratchpad.src}" defaultexcludes="yes">
904 <include name="org/apache/poi/**"/>
905 <exclude name="org/apache/poi/hdf/**"/>
907 <packageset dir="${contrib.src}" defaultexcludes="yes">
908 <include name="org/apache/poi/**"/>
910 <packageset dir="${examples.src}" defaultexcludes="yes">
911 <include name="org/apache/poi/**"/>
914 <classpath id="javadoc.classpath">
915 <path refid="main.classpath"/>
916 <path refid="scratchpad.classpath"/>
917 <path refid="contrib.classpath"/>
918 <path refid="examples.classpath"/>
919 <path path="${env.CLASSPATH}"/>
922 <doctitle><![CDATA[<h1>POI API Documentation</h1>]]></doctitle>
924 <![CDATA[<i>Copyright ${tstamp.year} The Apache Software Foundation or
925 its licensors, as applicable.</i>]]>
928 <title>DDF - Dreadful Drawing Format</title>
929 <package name="org.apache.poi.ddf*"/>
932 <title>HPSF - Horrible Property Set Format</title>
933 <package name="org.apache.poi.hpsf*"/>
936 <title>HSSF - Horrible Spreadsheet Format</title>
937 <package name="org.apache.poi.hssf*"/>
940 <title>HWPF - Horrible Word Processor Format</title>
941 <package name="org.apache.poi.hwpf*"/>
944 <title>POIFS - POI File System</title>
945 <package name="org.apache.poi.poifs*"/>
948 <title>Utilities</title>
949 <package name="org.apache.poi.util*"/>
952 <title>Examples</title>
953 <package name="org.apache.poi.hpsf.examples*"/>
954 <package name="org.apache.poi.hssf.usermodel.examples*"/>
958 <antcall target="clover.html"/>
963 <!-- ================================== -->
964 <!-- Generate records -->
965 <!-- ================================== -->
967 <target name="generate-records" depends="init"
968 description="Generates HSSF records">
969 <java classname="org.apache.poi.dev.RecordGenerator" fork="yes">
970 <arg file="src/records/definitions"/>
971 <arg file="src/records/styles"/>
972 <arg file="src/java"/>
973 <arg file="src/testcases"/>
975 <path refid="scratchpad.classpath"/>
976 <pathelement location="${main.output.dir}"/>
977 <pathelement location="${scratchpad.output.dir}"/>
982 <!-- ================================== -->
983 <!-- Generate types -->
984 <!-- ================================== -->
986 <target name="generate-types" depends="init"
987 description="Generates word types">
988 <java classname="org.apache.poi.dev.RecordGenerator" fork="yes">
989 <arg file="src/types/definitions"/>
990 <arg file="src/types/styles"/>
991 <arg file="src/scratchpad/src"/>
992 <arg file="src/scratchpad/testcases"/>
994 <path refid="scratchpad.classpath">
996 <pathelement location="${main.output.dir}"/>
997 <pathelement location="${scratchpad.output.dir}"/>
1004 <!-- Generates documentation and reports -->
1005 <target name="site" depends="reports, docs"
1006 description="Generates POI's website's contents"/>
1009 <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">
1010 <!-- Copy the jar files into the maven jar directory -->
1011 <!-- Same jars as for the main release, only lacking the datestamp -->
1013 file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar"
1014 tofile="${mavendist.oap.dir}/jars/${jar.name}-${version.id}.jar" />
1016 file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar"
1017 tofile="${mavendist.oap.dir}/jars/${jar.name}-contrib-${version.id}.jar" />
1019 file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar"
1020 tofile="${mavendist.oap.dir}/jars/${jar.name}-scratchpad-${version.id}.jar" />
1022 <!-- TODO: Decide about source jars, and copy them if we have some -->
1024 <!-- Build the org.apache.poi poms -->
1025 <!-- Copy from the base file, substituting in the version and -->
1026 <!-- artificat, plus doing the core poi dependency as needed -->
1028 <!-- Build the main pom -->
1031 tofile="${mavendist.oap.dir}/poms/${jar.name}-${version.id}.pom"
1035 <token key="VERSION" value="${version.id}" />
1036 <token key="ARTIFICAT" value="poi" />
1040 <replaceregex pattern="START_NON_MAIN.*END_NON_MAIN_DEPENDENCY" replace="No POI dependency on the main jar" flags="s" />
1044 <!-- And the contrib pom -->
1047 tofile="${mavendist.oap.dir}/poms/${jar.name}-contrib-${version.id}.pom"
1051 <token key="VERSION" value="${version.id}" />
1052 <token key="ARTIFICAT" value="poi-contrib" />
1055 <replaceregex pattern="..-- START_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
1056 <replaceregex pattern="..-- END_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
1060 <!-- And the scratchpad pom -->
1063 tofile="${mavendist.oap.dir}/poms/${jar.name}-scratchpad-${version.id}.pom"
1067 <token key="VERSION" value="${version.id}" />
1068 <token key="ARTIFICAT" value="poi-scratchpad" />
1071 <replaceregex pattern="..-- START_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
1072 <replaceregex pattern="..-- END_NON_MAIN_DEPENDENCY --." replace="" flags="s"/>
1077 <!-- Build the poi => org.apache.poi redirect poms -->
1078 <!-- Copy from the base file, substituting in the version+artifact -->
1080 file="poi-redirect.pom"
1081 tofile="${mavendist.poi.dir}/poms/${jar.name}-${version.id}.pom"
1083 <filterchain><replacetokens>
1084 <token key="VERSION" value="${version.id}" />
1085 <token key="ARTIFICAT" value="poi" />
1086 </replacetokens></filterchain>
1089 file="poi-redirect.pom"
1090 tofile="${mavendist.poi.dir}/poms/${jar.name}-contrib-${version.id}.pom"
1092 <filterchain><replacetokens>
1093 <token key="VERSION" value="${version.id}" />
1094 <token key="ARTIFICAT" value="poi-contrib" />
1095 </replacetokens></filterchain>
1098 file="poi-redirect.pom"
1099 tofile="${mavendist.poi.dir}/poms/${jar.name}-scratchpad-${version.id}.pom"
1101 <filterchain><replacetokens>
1102 <token key="VERSION" value="${version.id}" />
1103 <token key="ARTIFICAT" value="poi-scratchpad" />
1104 </replacetokens></filterchain>
1107 <!-- And that's it for maven -->
1110 <target name="jar" depends="compile" description="Creates jar files for distribution">
1111 <jar destfile="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar">
1112 <fileset dir="${main.output.dir}" />
1113 <fileset dir="legal/" />
1115 <attribute name="Built-By" value="${user.name}"/>
1116 <attribute name="Specification-Title" value="Apache POI"/>
1117 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
1118 <attribute name="Specification-Vendor" value="Apache"/>
1119 <attribute name="Implementation-Title" value="Apache POI"/>
1120 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
1121 <attribute name="Implementation-Vendor" value="Apache"/>
1124 <jar destfile="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar">
1125 <fileset dir="${contrib.output.dir}" />
1126 <fileset dir="legal/" />
1128 <attribute name="Built-By" value="${user.name}"/>
1129 <attribute name="Specification-Title" value="Apache POI"/>
1130 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
1131 <attribute name="Specification-Vendor" value="Apache"/>
1132 <attribute name="Implementation-Title" value="Apache POI"/>
1133 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
1134 <attribute name="Implementation-Vendor" value="Apache"/>
1137 <jar destfile="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar">
1138 <fileset dir="${scratchpad.output.dir}" />
1139 <fileset dir="legal/" />
1141 <attribute name="Built-By" value="${user.name}"/>
1142 <attribute name="Specification-Title" value="Apache POI"/>
1143 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
1144 <attribute name="Specification-Vendor" value="Apache"/>
1145 <attribute name="Implementation-Title" value="Apache POI"/>
1146 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
1147 <attribute name="Implementation-Vendor" value="Apache"/>
1151 <target name="jar-ooxml" depends="compile-ooxml" description="Creates the ooxml jar files for distribution">
1152 <jar destfile="${dist.dir}/${jar.name}-ooxml-${version.id}-${DSTAMP}.jar">
1153 <fileset dir="${ooxml.output.dir}" />
1154 <fileset dir="legal/" />
1156 <attribute name="Built-By" value="${user.name}"/>
1157 <attribute name="Specification-Title" value="Apache POI"/>
1158 <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
1159 <attribute name="Specification-Vendor" value="Apache"/>
1160 <attribute name="Implementation-Title" value="Apache POI"/>
1161 <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
1162 <attribute name="Implementation-Vendor" value="Apache"/>
1167 <target name="dist" depends="clean, fail-unless-tools-are-available, compile, site, jar"
1168 description="Creates the entire distribution into build/dist, from scratch">
1170 <property name="zipdir" value="${jar.name}-${version.id}" />
1172 <zip destfile="${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.zip">
1173 <zipfileset dir="legal/" prefix="${zipdir}" />
1174 <zipfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1175 <zipfileset file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1176 <zipfileset file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1177 <zipfileset file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1180 <zip destfile="${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.zip">
1181 <zipfileset dir="legal/" prefix="${zipdir}" />
1182 <zipfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1183 <zipfileset dir="." prefix="${zipdir}">
1184 <exclude name="build/**"/>
1185 <exclude name="scripts/**"/>
1186 <exclude name="*.ipr"/>
1187 <exclude name="*.iml"/>
1188 <exclude name="*.iws"/>
1189 <exclude name="*.swp"/>
1193 <tar destfile="${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.tar.gz"
1195 <tarfileset dir="legal/" prefix="${zipdir}" />
1196 <tarfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1197 <tarfileset file="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1198 <tarfileset file="${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1199 <tarfileset file="${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" prefix="${zipdir}" />
1202 <tar destfile="${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.tar.gz"
1204 <tarfileset dir="legal/" prefix="${zipdir}" />
1205 <tarfileset dir="${build.site}" prefix="${zipdir}/docs"/>
1206 <tarfileset dir="." prefix="${zipdir}">
1207 <exclude name="build/**"/>
1208 <exclude name="scripts/**"/>
1209 <exclude name="*.ipr"/>
1210 <exclude name="*.iml"/>
1211 <exclude name="*.iws"/>
1212 <exclude name="*.swp"/>
1216 <echo>Distribution located in build/dist</echo>
1219 <target name="clean-compile" depends="clean, compile"/>
1221 <target name="clean-dist" depends="clean, dist"
1222 description="Cleans the build directory then creates a distribution"/>
1224 <target name="gump" depends="test, jar"/>
1228 <!-- Generates the Ant document type definition (DTD) -->
1230 description="Generates the Ant document type definition (DTD)">
1231 <antstructure output="ant.dtd"/>
1237 <!-- Abort the build if JUnit is missing. -->
1238 <target name="fail-unless-junit-is-available" depends="init">
1239 <condition property="isAvailable.junit">
1240 <available classname="junit.framework.TestCase"/>
1242 <antcall target="fail-junit"/>
1245 <target name="fail-junit" unless="isAvailable.junit">
1247 JUnit is not available. You must download JUnit from
1248 <http://www.junit.org/> and include the JAR file in your
1251 <fail message="JUnit is not available."/>
1254 <!-- Warn if JUnit is missing. -->
1255 <target name="warn-unless-junit-is-available" depends="init">
1256 <condition property="isAvailable.junit">
1257 <available classname="junit.framework.TestCase"/>
1259 <antcall target="warn-junit"/>
1262 <target name="warn-junit" unless="isAvailable.junit">
1264 WARNING: Since JUnit is not available you might encounter failures
1265 subsequently. In order to avoid this you should download JUnit from
1266 <http://www.junit.org/> and include the JAR file in your
1273 <!-- Abort the build if JDepend is missing. -->
1274 <target name="fail-unless-jdepend-is-available" depends="init">
1275 <condition property="isAvailable.jdepend">
1276 <available classname="jdepend.framework.JDepend"/>
1278 <antcall target="fail-jdepend"/>
1281 <target name="fail-jdepend" unless="isAvailable.jdepend">
1283 JDepend is not available. You must download JDepend from
1284 <http://www.clarkware.com/software/JDepend.html> and include the
1285 JAR file in your classpath.
1287 <fail message="JDepend is not available."/>
1292 <!-- Abort the build if an XSLT processor is missing. -->
1293 <target name="fail-unless-xslt-is-available" depends="init">
1294 <condition property="isAvailable.xslt">
1295 <available classname="javax.xml.transform.TransformerFactory"/>
1297 <antcall target="fail-xslt"/>
1300 <target name="fail-xslt" unless="isAvailable.xslt">
1302 An XSLT processor is missing. You must download e.g. Xalan from
1303 <http://xml.apache.org/xalan-j/> and include the JAR file in your
1306 <fail message="An XSLT processor is not available."/>
1309 <!-- Warn if an XSLT processor is missing. -->
1310 <target name="warn-unless-xslt-is-available" depends="init">
1311 <condition property="isAvailable.xslt">
1312 <available classname="javax.xml.transform.TransformerFactory"/>
1314 <antcall target="warn-xslt"/>
1317 <target name="warn-xslt" unless="isAvailable.xslt">
1319 WARNING: Since an XSLT processor is not available you might encounter
1320 failures subsequently. In order to avoid this you should download
1321 e.g. Xalan from <http://xml.apache.org/xalan-j/> and include the
1322 JAR file in your classpath.
1328 <!-- Aborts the build if any of the required tools are missing. -->
1329 <target name="fail-unless-tools-are-available"
1330 depends="fail-unless-junit-is-available, fail-unless-junit-is-available,
1331 fail-unless-jdepend-is-available"/>
1335 <!-- Runs jdepend to produce a report about package dependencies -->
1336 <target name="jdepend" depends="fail-unless-jdepend-is-available"
1337 description="Runs jdepend to produce a report about package dependencies">
1338 <jdepend outputfile="${jdepend.report.dir}/jdepend.xml" format="xml">
1340 <pathelement location="${main.output.dir}"/>
1341 <pathelement location="${contrib.output.dir}"/>
1342 <pathelement location="${scratchpad.output.dir}"/>
1345 <path refid="main.classpath"/>
1346 <path refid="contrib.classpath"/>
1347 <path refid="scratchpad.classpath"/>
1351 <style basedir="${jdepend.report.dir}"
1352 in="${jdepend.report.dir}/jdepend.xml"
1353 out="${jdepend.report.out.dir}/index.html"
1354 style="jdepend.xsl"/>
1359 <!-- Keep this comment at the end of the file
1364 sgml-namecase-general:nil
1365 sgml-general-insert-case:lower
1366 sgml-minimize-attributes:nil
1367 sgml-always-quote-attributes:t
1370 sgml-parent-document:nil
1371 sgml-exposed-tags:nil
1372 sgml-local-catalogs:nil
1373 sgml-local-ecat-files:nil