2002-02-14 21:11:36 -05:00
<?xml version="1.0"?>
2004-04-09 09:05:39 -04:00
<!-- Copyright (C) 2004 The Apache Software Foundation. All rights reserved. -->
2003-09-04 15:52:11 -04:00
<!DOCTYPE project PUBLIC "-//Ant//Project 1.5//EN" "ant.dtd">
2003-04-23 20:53:41 -04:00
<!--
POI Build System. Written by:
Glen Stampoultzis glens at apache.org
2004-12-31 08:26:31 -05:00
Modified by:
2003-04-23 20:53:41 -04:00
2004-12-31 08:26:31 -05:00
Rainer Klute klute@rainer-klute.de
This build was tested with ant 1.6.2 although it will probably work with
2005-01-01 00:21:10 -05:00
other versions. The following jar files should be available on the
2004-12-31 08:26:31 -05:00
classpath when running ant:
2003-04-23 20:53:41 -04:00
LIBRARY LOCATION
======= ========
2003-05-04 05:17:06 -04:00
junit(3.8+) http://www.ibiblio.org/maven/junit/jars/
2003-04-23 20:53:41 -04:00
xerces http://www.ibiblio.org/maven/xerces/jars/
jdepend http://www.ibiblio.org/maven/jdepend/jars/
2003-07-14 08:11:12 -04:00
xalan http://www.ibiblio.org/maven/xalan/jars/
2003-04-23 20:53:41 -04:00
2003-05-17 01:43:08 -04:00
The ant jar "optional.jar" should also be available otherwise the
build will fail.
2003-04-23 20:53:41 -04:00
To build the documentation you will need to install forrest and set
2003-10-22 19:16:34 -04:00
the FORREST_HOME environment variable. Forrest 0.5.1 required.
2003-04-23 20:53:41 -04:00
TO BE COMPLETED:
Convert book.xml files to a sitemap.
-->
2003-10-22 19:16:34 -04:00
<project name= "POI Build" default= "help" basedir= "." >
2003-04-23 20:53:41 -04:00
2005-01-01 18:39:42 -05:00
<description >
The POI project Ant build.
</description>
2003-04-23 20:53:41 -04:00
2005-01-25 15:08:18 -05:00
<property environment= "env" />
<property name= "repository" value= "http://www.ibiblio.org/maven" />
<property name= "forrest.home" value= "${env.FORREST_HOME}" />
<!-- Main: -->
<property name= "main.resource1.dir" value= "src/resources/fontmetrics" />
<property name= "main.src" location= "src/java" />
<property name= "main.src.test" location= "src/testcases" />
<property name= "main.documentation" value= "src/documentation" />
<property name= "main.output.dir" location= "build/classes" />
<property name= "main.output.test.dir" location= "build/test-classes" />
<property name= "main.lib" location= "lib" />
<property name= "main.reports.test" location= "build/test-results" />
<property name= "main.jar1.dir" location= "${main.lib}/commons-logging-1.0.1.jar" />
<property name= "main.jar1.url" value= "${repository}/commons-logging/jars/commons-logging-1.0.1.jar" />
<property name= "main.jar2.dir" location= "${main.lib}/log4j-1.2.8.jar" />
<property name= "main.jar2.url" value= "${repository}/log4j/jars/log4j-1.2.8.jar" />
<property name= "main.testokfile" location= "build/main-testokfile.txt" />
<!-- Scratchpad: -->
<property name= "scratchpad.src" location= "src/scratchpad/src" />
<property name= "scratchpad.src.test" location= "src/scratchpad/testcases" />
<property name= "scratchpad.lib" location= "src/scratchpad/lib" />
<property name= "scratchpad.reports.test" location= "build/scratchpad-test-results" />
<property name= "scratchpad.output.dir" location= "build/scratchpad-classes" />
<property name= "scratchpad.output.test.dir" location= "build/scratchpad-test-classes" />
<property name= "scratchpad.testokfile" location= "build/scratchpad-testokfile.txt" />
<!-- Contributed software: -->
<property name= "contrib.src" location= "src/contrib/src" />
<property name= "contrib.src.test" location= "src/contrib/testcases" />
<property name= "contrib.lib" location= "src/contrib/lib" />
<property name= "contrib.reports.test" location= "build/contrib-test-results" />
<property name= "contrib.output.dir" location= "build/contrib-classes" />
<property name= "contrib.output.test.dir" location= "build/contrib-test-classes" />
<property name= "contrib.jar1.dir" location= "${contrib.lib}/commons-beanutils-1.6.jar" />
<property name= "contrib.jar1.url" value= "${repository}/commons-beanutils/jars/commons-beanutils-1.6.jar" />
<property name= "contrib.jar2.dir" location= "${contrib.lib}/commons-collections-2.1.jar" />
<property name= "contrib.jar2.url" value= "${repository}/commons-collections/jars/commons-collections-2.1.jar" />
<property name= "contrib.jar3.dir" location= "${contrib.lib}/commons-lang-1.0-b1.jar" />
<property name= "contrib.jar3.url" value= "${repository}/commons-lang/jars/commons-lang-1.0-b1.jar" />
<property name= "contrib.testokfile" location= "build/contrib-testokfile.txt" />
<!-- Examples: -->
<property name= "examples.src" location= "src/examples/src" />
<property name= "examples.src.test" location= "src/examples/testcases" />
<property name= "examples.lib" location= "src/examples/lib" />
<property name= "examples.reports.test" location= "build/examples-test-results" />
<property name= "examples.output.dir" location= "build/examples-classes" />
<property name= "examples.output.test.dir" location= "build/examples-test-classes" />
<property name= "examples.jar1.dir" location= "${examples.lib}/commons-beanutils-1.6.jar" />
<property name= "examples.jar1.url" value= "${repository}/commons-beanutils/jars/commons-beanutils-1.6.jar" />
<property name= "examples.jar2.dir" location= "${examples.lib}/commons-collections-2.1.jar" />
<property name= "examples.jar2.url" value= "${repository}/commons-collections/jars/commons-collections-2.1.jar" />
<property name= "examples.jar3.dir" location= "${examples.lib}/commons-lang-1.0-b1.jar" />
<property name= "examples.jar3.url" value= "${repository}/commons-lang/jars/commons-lang-1.0-b1.jar" />
<property name= "examples.testokfile" location= "build/examples-testokfile.txt" />
2003-08-23 15:07:41 -04:00
<property name= "junit.jar1.dir" location= "${main.lib}/junit-3.8.1.jar" />
2003-04-23 20:53:41 -04:00
<property name= "junit.jar1.url" value= "${repository}/junit/jars/junit-3.8.1.jar" />
2003-08-23 15:07:41 -04:00
<property name= "build.site" location= "build/tmp/site/build/site" />
<property name= "build.site.src" location= "build/tmp/site" />
<property name= "junit.report.dir" location= "${build.site}/junit" />
<property name= "jdepend.report.dir" location= "${build.site}/jdepend" />
<property name= "jdepend.report.out.dir" location= "${build.site.src}/src/documentation/content/jdepend" />
<property name= "apidocs.report.dir" location= "${build.site}/apidocs" />
<property name= "changelog.file" location= "${build.site}/changelog.html" />
<property name= "dist.dir" location= "build/dist" />
2003-04-23 20:53:41 -04:00
<property name= "jar.name" value= "poi" />
2003-08-04 09:58:48 -04:00
<property name= "version.id" value= "2.1" />
2003-04-23 20:53:41 -04:00
<property name= "halt.on.test.failure" value= "true" />
<path id= "main.classpath" >
<pathelement location= "${main.jar1.dir}" />
<pathelement location= "${main.jar2.dir}" />
2004-04-18 09:02:48 -04:00
<pathelement location= "${main.resource1.dir}" />
2003-04-23 20:53:41 -04:00
</path>
<path id= "scratchpad.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
</path>
<path id= "contrib.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${contrib.jar1.dir}" />
<pathelement location= "${contrib.jar2.dir}" />
<pathelement location= "${contrib.jar3.dir}" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${main.output.test.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
<pathelement location= "${scratchpad.output.test.dir}" />
<pathelement location= "${contrib.output.dir}" />
<pathelement location= "${contrib.output.test.dir}" />
</path>
2005-01-25 15:08:18 -05:00
<path id= "examples.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
</path>
2005-01-01 18:39:42 -05:00
<!-- Prints POI's Ant usage help -->
<target name= "help" description= "Prints POI's Ant usage help" >
<echo >
- Execute "ant -projecthelp" to view a listing of the main build
targets.
- Execute "ant help-properties" to view a listing of some properties
controlling the build process.
</echo>
</target>
<target name= "help-properties"
description="Prints a listing of build controlling properties">
<echo >
The following properties control the build process:
-Ddisconnected="true": Do not execute any targets that require an online
connection to the Internet.
WARNING: This list is not exhaustive.
</echo>
</target>
2003-10-22 19:16:34 -04:00
2004-04-09 07:45:38 -04:00
<target name= "with.clover" if= "clover.present" >
<taskdef resource= "clovertasks" />
<clover-setup initString= "mycoverage.db" />
</target>
<target name= "clover.html" depends= "with.clover" if= "clover.present" >
<echo > Generating clover report</echo>
<clover-report >
<current outfile= "build/tmp/site/build/site/clover_html" >
<format type= "html" />
</current>
</clover-report>
</target>
2003-04-23 20:53:41 -04:00
<target name= "init" depends= "check-jars,fetch-jars" >
2005-01-20 12:17:19 -05:00
<tstamp >
<format property= "tstamp.year" pattern= "yyyy" />
</tstamp>
2003-04-23 20:53:41 -04:00
2004-04-09 07:45:38 -04:00
<available resource= "clovertasks" property= "clover.present" />
<antcall target= "with.clover" />
2003-04-23 20:53:41 -04:00
<mkdir dir= "build" />
<mkdir dir= "${main.output.dir}" />
<mkdir dir= "${scratchpad.output.dir}" />
2005-01-25 15:08:18 -05:00
<mkdir dir= "${contrib.output.dir}" />
<mkdir dir= "${examples.output.dir}" />
2003-04-23 20:53:41 -04:00
<mkdir dir= "${main.output.test.dir}" />
<mkdir dir= "${contrib.output.test.dir}" />
<mkdir dir= "${scratchpad.output.test.dir}" />
<mkdir dir= "${main.reports.test}" />
<mkdir dir= "${scratchpad.reports.test}" />
<mkdir dir= "${contrib.reports.test}" />
<mkdir dir= "${junit.report.dir}" />
<mkdir dir= "${jdepend.report.dir}" />
<mkdir dir= "${jdepend.report.out.dir}" />
<mkdir dir= "${apidocs.report.dir}" />
<mkdir dir= "${dist.dir}" />
<mkdir dir= "${build.site.src}/${main.documentation}" />
<copy todir= "${build.site.src}/${main.documentation}" >
<fileset dir= "${main.documentation}" />
</copy>
<copy file= "forrest.properties" tofile= "${build.site.src}/forrest.properties" />
</target>
<target name= "clean" >
<delete dir= "build" />
</target>
<target name= "check-jars" >
<condition property= "jars.present" >
2003-07-14 08:11:12 -04:00
<or >
<and >
<available file= "${main.jar1.dir}" />
<available file= "${main.jar2.dir}" />
<available file= "${contrib.jar1.dir}" />
<available file= "${contrib.jar2.dir}" />
<available file= "${contrib.jar3.dir}" />
<available file= "${junit.jar1.dir}" />
</and>
<isset property= "disconnected" />
</or>
2003-04-23 20:53:41 -04:00
</condition>
</target>
2003-07-26 03:31:42 -04:00
<target name= "fetch-jars" unless= "jars.present"
description="Fetches needed JAR files from the Internet">
2003-04-23 20:53:41 -04:00
<get src= "${main.jar1.url}" dest= "${main.jar1.dir}" />
<get src= "${main.jar2.url}" dest= "${main.jar2.dir}" />
<get src= "${contrib.jar1.url}" dest= "${contrib.jar1.dir}" />
<get src= "${contrib.jar2.url}" dest= "${contrib.jar2.dir}" />
<get src= "${contrib.jar3.url}" dest= "${contrib.jar3.dir}" />
<get src= "${junit.jar1.url}" dest= "${junit.jar1.dir}" />
</target>
2005-01-25 15:08:18 -05:00
<target name= "compile" depends= "init, c o m p i l e - m a i n , c o m p i l e - s c r a t c h p a d ,
compile-contrib, compile-examples"
description="Compiles the POI main classes, scratchpad, contrib, and examples"/>
2003-04-23 20:53:41 -04:00
<target name= "compile-main" depends= "init" >
2004-04-18 09:02:48 -04:00
<copy todir= "${main.output.dir}" >
<fileset dir= "${main.resource1.dir}" />
</copy>
2003-04-28 22:24:26 -04:00
<javac srcdir= "${main.src}" destdir= "${main.output.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath refid= "main.classpath" />
</javac>
2003-04-28 22:24:26 -04:00
<javac srcdir= "${main.src.test}" destdir= "${main.output.test.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
</javac>
</target>
<target name= "compile-scratchpad" depends= "init" >
2003-04-28 22:24:26 -04:00
<javac srcdir= "${scratchpad.src}" destdir= "${scratchpad.output.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath refid= "scratchpad.classpath" />
</javac>
2003-04-28 22:24:26 -04:00
<javac srcdir= "${scratchpad.src.test}" destdir= "${scratchpad.output.test.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "scratchpad.classpath" />
<pathelement location= "${scratchpad.output.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
</javac>
</target>
<target name= "compile-contrib" depends= "init" >
2003-04-28 22:24:26 -04:00
<javac srcdir= "${contrib.src}" destdir= "${contrib.output.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath refid= "contrib.classpath" />
</javac>
2003-04-28 22:24:26 -04:00
<javac srcdir= "${contrib.src.test}" destdir= "${contrib.output.test.dir}" debug= "on" >
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "contrib.classpath" />
<pathelement location= "${contrib.output.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
</javac>
</target>
2005-01-25 15:08:18 -05:00
<target name= "compile-examples" depends= "init" >
<javac srcdir= "${examples.src}" destdir= "${examples.output.dir}" debug= "on" >
<classpath refid= "examples.classpath" />
</javac>
</target>
2003-04-23 20:53:41 -04:00
<target name= "test" depends= "test-main,test-scratchpad,test-contrib"
2003-07-26 03:31:42 -04:00
description="Tests main, contrib and scratchpad"/>
2003-04-23 20:53:41 -04:00
<target name= "-test-main-check" >
<uptodate property= "main.test.notRequired" targetfile= "${main.testokfile}" >
<srcfiles dir= "${main.src}" />
<srcfiles dir= "${main.src.test}" />
</uptodate>
</target>
2003-07-14 08:11:12 -04:00
<path id= "test.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${main.output.test.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</path>
2004-12-31 08:26:31 -05:00
<target
name="test-main"
depends="compile-main, -test-main-check, is-available-junit"
unless="main.test.notRequired">
2004-04-09 07:45:38 -04:00
<junit printsummary= "no" showoutput= "true" fork= "no"
2003-04-23 20:53:41 -04:00
haltonfailure="${halt.on.test.failure}" failureproperty="main.test.failed">
2003-07-14 08:11:12 -04:00
<classpath refid= "test.classpath" />
2003-08-23 15:07:41 -04:00
<sysproperty key= "HSSF.testdata.path" file= "${main.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${main.src.test}/org/apache/poi/hpsf/data" />
2004-04-09 08:19:08 -04:00
<sysproperty key= "java.awt.headless" value= "true" />
2003-04-23 20:53:41 -04:00
<formatter type= "plain" />
<formatter type= "xml" />
<batchtest todir= "${main.reports.test}" >
<fileset dir= "${main.src.test}" >
<include name= "**/Test*.java" />
<exclude name= "**/AllTests.java" />
2005-04-21 09:46:38 -04:00
<exclude name= "**/TestEmptyDocument.java" />
2003-04-23 20:53:41 -04:00
</fileset>
</batchtest>
</junit>
<delete file= "${main.testokfile}" />
<antcall target= "-test-main-write-testfile" />
</target>
2003-05-09 07:09:51 -04:00
2005-04-21 09:46:38 -04:00
<target name= "test-fail" depends = "compile-main, is-available-junit" description= "run tests that are known to fail" >
<junit printsummary= "yes" showoutput= "true" filtertrace= "no" haltonfailure= "false" >
<classpath refid= "test.classpath" />
<classpath >
<path refid= "scratchpad.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
<pathelement location= "${scratchpad.output.test.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
<sysproperty key= "HSSF.testdata.path" file= "${main.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${main.src.test}/org/apache/poi/hpsf/data" />
<sysproperty key= "HWPF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hwpf/data" />
<sysproperty key= "java.awt.headless" value= "true" />
<formatter type= "plain" usefile= "no" />
<batchtest todir= "${main.reports.test}" >
<fileset dir= "${main.src.test}" >
<include name= "**/TestEmptyDocument.java" />
</fileset>
</batchtest>
</junit>
</target>
2003-10-22 19:16:34 -04:00
<target name= "single-test" depends= "-test-property-check,compile-main" description= "Runs a single test case specified with -Dtestcase=classname" >
2005-04-21 09:46:38 -04:00
<junit printsummary= "yes" showoutput= "true" filtertrace= "no" haltonfailure= "false" >
2003-07-14 08:11:12 -04:00
<classpath refid= "test.classpath" />
2005-04-21 09:46:38 -04:00
<classpath >
<path refid= "scratchpad.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
<pathelement location= "${scratchpad.output.test.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
2003-08-23 15:07:41 -04:00
<sysproperty key= "HSSF.testdata.path" file= "${main.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${main.src.test}/org/apache/poi/hpsf/data" />
2005-04-21 09:46:38 -04:00
<sysproperty key= "HWPF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hwpf/data" />
<sysproperty key= "java.awt.headless" value= "true" />
2003-05-04 05:17:06 -04:00
<formatter type= "plain" usefile= "no" />
<formatter type= "xml" />
2003-07-14 08:11:12 -04:00
<test name= "${testcase}" />
</junit>
</target>
2003-10-22 19:16:34 -04:00
<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." >
2003-07-14 08:11:12 -04:00
<junit printsummary= "no" showoutput= "true" filtertrace= "no" fork= "yes" haltonfailure= "${halt.on.test.failure}" failureproperty= "main.test.failed" >
<jvmarg value= "-Xdebug" />
<jvmarg value= "-Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=y" />
<sysproperty key= "java.compiler" value= "NONE" />
<classpath refid= "test.classpath" />
2003-08-23 15:07:41 -04:00
<sysproperty key= "HSSF.testdata.path" file= "${main.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${main.src.test}/org/apache/poi/hpsf/data" />
2004-04-09 08:19:08 -04:00
<sysproperty key= "java.awt.headless" value= "true" />
2003-07-14 08:11:12 -04:00
<formatter type= "plain" usefile= "no" />
<test name= "${testcase}" />
</junit>
</target>
<target name= "-test-property-check" unless= "testcase" >
<echo message= "Please use -Dtestcase=org.your.testcase to run a single test" />
<fail />
2003-05-04 05:17:06 -04:00
</target>
2003-04-23 20:53:41 -04:00
<target name= "-test-main-write-testfile" unless= "main.test.failed" >
<echo file= "${main.testokfile}" append= "false" message= "testok" />
</target>
<target name= "-test-scratchpad-check" >
<uptodate property= "scratchpad.test.notRequired" targetfile= "${scratchpad.testokfile}" >
<srcfiles dir= "${scratchpad.src}" />
<srcfiles dir= "${scratchpad.src.test}" />
</uptodate>
</target>
<target name= "test-scratchpad" depends= "compile-scratchpad,-test-scratchpad-check" unless= "scratchpad.test.notRequired" >
2004-04-09 07:45:38 -04:00
<junit printsummary= "no" fork= "no" haltonfailure= "${halt.on.test.failure}" failureproperty= "scratchpad.test.failed" >
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "scratchpad.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
<pathelement location= "${scratchpad.output.test.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
2003-08-23 15:07:41 -04:00
<sysproperty key= "HSSF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hpsf/data" />
<sysproperty key= "HDF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hdf/data" />
<sysproperty key= "HWPF.testdata.path" file= "${scratchpad.src.test}/org/apache/poi/hwpf/data" />
2004-04-09 08:19:08 -04:00
<sysproperty key= "java.awt.headless" value= "true" />
2003-08-23 15:07:41 -04:00
<formatter type= "plain" />
2003-04-23 20:53:41 -04:00
<formatter type= "xml" />
<batchtest todir= "${scratchpad.reports.test}" >
<fileset dir= "${scratchpad.src.test}" >
<include name= "**/Test*.java" />
<exclude name= "**/AllTests.java" />
</fileset>
</batchtest>
</junit>
<delete file= "${scratchpad.testokfile}" />
<antcall target= "-test-scratchpad-write-testfile" />
</target>
<target name= "-test-scratchpad-write-testfile" unless= "scratchpad.test.failed" >
<echo file= "${scratchpad.testokfile}" append= "false" message= "testok" />
</target>
<target name= "-test-contrib-check" >
<uptodate property= "contrib.test.notRequired" targetfile= "${contrib.testokfile}" >
<srcfiles dir= "${contrib.src}" />
<srcfiles dir= "${contrib.src.test}" />
</uptodate>
</target>
<target name= "test-contrib" depends= "compile-contrib,-test-contrib-check" unless= "contrib.test.notRequired" >
2003-08-23 15:07:41 -04:00
<junit printsummary= "yes" fork= "no" haltonfailure= "${halt.on.test.failure}" failureproperty= "contrib.test.failed" >
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "contrib.classpath" />
<pathelement location= "${main.output.dir}" />
<pathelement location= "${contrib.output.dir}" />
<pathelement location= "${contrib.output.test.dir}" />
<pathelement location= "${junit.jar1.dir}" />
</classpath>
2003-08-23 15:07:41 -04:00
<sysproperty key= "HSSF.testdata.path" file= "${contrib.src.test}/org/apache/poi/hssf/data" />
<sysproperty key= "HPSF.testdata.path" file= "${contrib.src.test}/org/apache/poi/hpsf/data" />
2004-04-09 08:19:08 -04:00
<sysproperty key= "java.awt.headless" value= "true" />
2003-08-23 15:07:41 -04:00
<formatter type= "plain" />
2003-04-23 20:53:41 -04:00
<formatter type= "xml" />
<batchtest todir= "${contrib.reports.test}" >
<fileset dir= "${contrib.src.test}" >
<include name= "**/Test*.java" />
<exclude name= "**/AllTests.java" />
</fileset>
</batchtest>
</junit>
<delete file= "${contrib.testokfile}" />
<antcall target= "-test-contrib-write-testfile" />
</target>
<target name= "-test-contrib-write-testfile" unless= "contrib.test.failed" >
<echo file= "${contrib.testokfile}" append= "false" message= "testok" />
</target>
<target name= "-check-docs" >
<uptodate property= "main.docs.notRequired" targetfile= "${build.site}/index.html" >
<srcfiles dir= "${build.site.src}" />
</uptodate>
</target>
<target name= "-check-forrest-installed" unless= "env.FORREST_HOME" >
2003-08-02 15:48:57 -04:00
<echo > Please install Apache Forrest (see
< http://xml.apache.org/forrest/index.html> ) and set the
FORREST_HOME environment variable!</echo>
<fail message= "Apache Forrest is not installed." />
2003-04-23 20:53:41 -04:00
</target>
<!-- <target name="check - docs"> -->
<!-- <uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html" > -->
<!-- <srcfiles dir= "${build.site.src}"/> -->
<!-- </uptodate> -->
<!-- </target> -->
2005-01-03 10:38:43 -05:00
<target name= "docs" depends= "init, -check-forrest-installed, -check-docs"
unless="main.docs.notRequired" description="Builds the POI website">
2003-04-23 20:53:41 -04:00
<mkdir dir= "${build.site.src}/src/documentation/content/apidocs" />
<copy todir= "${build.site.src}/src/documentation/content/apidocs" >
<fileset dir= "${apidocs.report.dir}" />
</copy>
2004-12-31 08:26:31 -05:00
<copy
tofile="${build.site.src}/src/documentation/content/jdepend.ehtml"
file="${jdepend.report.dir}/index.html" failonerror="false"/>
2003-04-23 20:53:41 -04:00
<mkdir dir= "${build.site.src}/src/documentation/content/junit" />
<copy todir= "${build.site.src}/src/documentation/content/junit" >
<fileset dir= "${junit.report.dir}" />
</copy>
2004-12-31 08:26:31 -05:00
<move
file="${build.site.src}/src/documentation/content/xdocs/status.xml"
tofile="${build.site.src}/status.xml"/>
2003-04-23 20:53:41 -04:00
<ant antfile= "${forrest.home}/forrest.antproxy.xml" target= "site" >
2003-08-23 15:07:41 -04:00
<property name= "project.home" location= "${build.site.src}" />
2003-04-23 20:53:41 -04:00
</ant>
<echo > Broken links:</echo>
<echo file= "${build.site}/../tmp/brokenlinks.txt" />
<touch >
<fileset dir= "${build.site}" />
</touch>
</target>
<!-- Checks whether reports are required to be run. If nothing has changed then they dont. -->
<target name= "-check-reports" >
<condition property= "reports.notRequired" >
<and >
<equals arg1= "${main.test.notRequired}" arg2= "true" />
<equals arg1= "${scratchpad.test.notRequired}" arg2= "true" />
<equals arg1= "${contrib.test.notRequired}" arg2= "true" />
</and>
</condition>
</target>
2003-07-14 08:11:12 -04:00
2005-01-01 18:39:42 -05:00
<!-- Generates a log of the latest changes in the CVS repository. -->
<target name= "cvschangelog" unless= "disconnected" depends= "is-available-xslt"
description="Generates a CVS change log report">
<antcall target= "cvs-rsh-warning" />
<cvschangelog destfile= "${changelog.file}" daysinpast= "30" />
<style in= "${changelog.file}"
out="${build.site.src}/src/documentation/content/changelog.html"
style="changelog.xsl">
<param name= "title" expression= "POI Change Log" />
<param name= "module" expression= "jakarta-poi" />
<param name= "cvsweb" expression= "http://cvs.apache.org/viewcvs/" />
</style>
</target>
<target name= "cvs-rsh-warning" unless= "env.CVS_RSH" >
<echo >
WARNING: The environment variable CVS_RSH is not set. If you cannot
access the CVS repository this could be one of the reasons for the
failure.
</echo>
</target>
2003-04-23 20:53:41 -04:00
2005-01-01 18:39:42 -05:00
<!-- Creates reports and API documentation -->
<target name= "reports" unless= "reports.notRequired" depends= "-check-reports,
is-available-xslt, is-available-junit, is-available-jdepend,
2005-01-03 10:38:43 -05:00
test-ignore-failures, junitreport, jdepend, cvschangelog, javadocs,
clover.html"
2005-01-01 18:39:42 -05:00
description="Creates various reports and the API documentation">
</target>
<!-- Runs all JUnit tests without aborting if one of the tests fails. -->
<target name= "test-ignore-failures" depends= "init" >
2004-12-31 08:26:31 -05:00
<antcall target= "test" >
<param name= "halt.on.test.failure" value= "false" />
</antcall>
2005-01-01 18:39:42 -05:00
</target>
2003-04-23 20:53:41 -04:00
2005-01-01 18:39:42 -05:00
<!-- Produces a report of the JUnit test results -->
<target name= "junitreport" depends= "is-available-xslt, test-ignore-failures"
description="Produces a report of the JUnit test results">
2004-12-31 08:26:31 -05:00
<junitreport todir= "${junit.report.dir}" >
<fileset dir= "${main.reports.test}" >
<include name= "TEST-*.xml" />
</fileset>
<fileset dir= "${scratchpad.reports.test}" >
<include name= "TEST-*.xml" />
</fileset>
<fileset dir= "${contrib.reports.test}" >
<include name= "TEST-*.xml" />
</fileset>
<report format= "frames" todir= "${junit.report.dir}" />
</junitreport>
</target>
2003-09-04 15:52:11 -04:00
2004-12-31 08:26:31 -05:00
2005-01-01 18:39:42 -05:00
<!-- Generates the API documentation. -->
2005-01-20 12:17:19 -05:00
<target name= "javadocs" depends= "init"
description="Generates the API documentation">
2003-09-04 15:52:11 -04:00
<javadoc
destdir="${apidocs.report.dir}"
author="true"
version="true"
use="true"
verbose="false"
2005-01-25 15:08:18 -05:00
windowtitle="POI API Documentation">
2003-09-04 15:52:11 -04:00
<packageset dir= "${main.src}" defaultexcludes= "yes" >
2004-12-31 08:26:31 -05:00
<include name= "org/apache/poi/**" />
2003-09-04 15:52:11 -04:00
</packageset>
<packageset dir= "${scratchpad.src}" defaultexcludes= "yes" >
2004-12-31 08:26:31 -05:00
<include name= "org/apache/poi/**" />
2003-09-04 15:52:11 -04:00
</packageset>
<packageset dir= "${contrib.src}" defaultexcludes= "yes" >
2004-12-31 08:26:31 -05:00
<include name= "org/apache/poi/**" />
2003-09-04 15:52:11 -04:00
</packageset>
2005-01-25 15:08:18 -05:00
<packageset dir= "${examples.src}" defaultexcludes= "yes" >
<include name= "org/apache/poi/**" />
</packageset>
2003-09-04 15:52:11 -04:00
<classpath >
2004-12-31 08:26:31 -05:00
<path refid= "main.classpath" />
<path refid= "scratchpad.classpath" />
<path refid= "contrib.classpath" />
2005-01-25 15:08:18 -05:00
<path refid= "examples.classpath" />
2003-09-04 15:52:11 -04:00
</classpath>
2005-01-25 15:08:18 -05:00
<doctitle > <![CDATA[<h1>POI API Documentation</h1>]]> </doctitle>
2005-01-01 18:39:42 -05:00
<bottom >
2005-01-20 12:17:19 -05:00
<![CDATA[<i> Copyright ${tstamp.year} The Apache Software Foundation or
2005-01-25 15:08:18 -05:00
its licensors, as applicable.</i> ]]>
2005-01-01 18:39:42 -05:00
</bottom>
<group title= "HDF" packages= "org.apache.poi.hdf*" />
2003-09-04 15:52:11 -04:00
<group title= "HPSF" packages= "org.apache.poi.hpsf*" />
2005-01-01 18:39:42 -05:00
<group title= "HSSF" packages= "org.apache.poi.hssf*" />
<group title= "HWPF" packages= "org.apache.poi.hwpf*" />
2003-09-04 15:52:11 -04:00
<group title= "POIFS" packages= "org.apache.poi.poifs*" />
<group title= "Record Generator" packages= "org.apache.poi.record*" />
<group title= "Utils" packages= "org.apache.poi.util*" />
2005-01-25 15:08:18 -05:00
<group >
<title > Examples</title>
<package name= "org.apache.poi.hpsf.examples*" />
<package name= "org.apache.poi.hssf.usermodel.examples*" />
</group>
2003-09-04 15:52:11 -04:00
</javadoc>
2004-04-09 07:45:38 -04:00
<antcall target= "clover.html" />
2003-09-04 15:52:11 -04:00
</target>
2002-05-29 10:37:37 -04:00
<!-- ================================== -->
2003-04-23 20:53:41 -04:00
<!-- Generate records -->
2002-05-29 10:37:37 -04:00
<!-- ================================== -->
2003-04-23 20:53:41 -04:00
<target name= "generate-records" depends= "init"
2003-10-22 19:16:34 -04:00
description="Generates HSSF records">
2003-04-23 20:53:41 -04:00
<java classname= "org.apache.poi.dev.RecordGenerator" fork= "yes" >
2003-08-23 15:07:41 -04:00
<arg location= "src/records/definitions" />
<arg location= "src/records/styles" />
<arg location= "src/java" />
<arg location= "src/testcases" />
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "scratchpad.classpath" >
</path>
<pathelement location= "${main.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
</classpath>
</java>
2002-05-29 10:37:37 -04:00
</target>
2003-04-23 20:53:41 -04:00
<!-- ================================== -->
<!-- Generate types -->
<!-- ================================== -->
<target name= "generate-types" depends= "init"
2003-10-22 19:16:34 -04:00
description="Generates word types">
2003-04-23 20:53:41 -04:00
<java classname= "org.apache.poi.dev.RecordGenerator" fork= "yes" >
2003-08-23 15:07:41 -04:00
<arg location= "src/types/definitions" />
<arg location= "src/types/styles" />
<arg location= "src/scratchpad/src" />
<arg location= "src/scratchpad/testcases" />
2003-04-23 20:53:41 -04:00
<classpath >
<path refid= "scratchpad.classpath" >
</path>
<pathelement location= "${main.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
</classpath>
</java>
2002-05-29 10:37:37 -04:00
</target>
2003-04-23 20:53:41 -04:00
2005-01-01 18:39:42 -05:00
<!-- Generates documentation and reports -->
<target name= "site" depends= "reports, docs"
description="Generates POI's website's contents"/>
2003-04-23 20:53:41 -04:00
<target name= "jar" depends= "compile" description= "Creates jar files for distribution" >
2004-08-23 04:52:54 -04:00
<jar basedir= "${main.output.dir}" destfile= "${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" >
<manifest >
<attribute name= "Built-By" value= "${user.name}" />
<section name= "common" >
<attribute name= "Specification-Title" value= "Jakarta POI" />
<attribute name= "Specification-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Specification-Vendor" value= "Apache" />
<attribute name= "Implementation-Title" value= "Jakarta POI" />
<attribute name= "Implementation-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Implementation-Vendor" value= "Apache" />
</section>
</manifest>
</jar>
<jar basedir= "${contrib.output.dir}" destfile= "${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" >
<manifest >
<attribute name= "Built-By" value= "${user.name}" />
<section name= "common" >
<attribute name= "Specification-Title" value= "Jakarta POI" />
<attribute name= "Specification-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Specification-Vendor" value= "Apache" />
<attribute name= "Implementation-Title" value= "Jakarta POI" />
<attribute name= "Implementation-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Implementation-Vendor" value= "Apache" />
</section>
</manifest>
</jar>
<jar basedir= "${scratchpad.output.dir}" destfile= "${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" >
<manifest >
<attribute name= "Built-By" value= "${user.name}" />
<section name= "common" >
<attribute name= "Specification-Title" value= "Jakarta POI" />
<attribute name= "Specification-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Specification-Vendor" value= "Apache" />
<attribute name= "Implementation-Title" value= "Jakarta POI" />
<attribute name= "Implementation-Version" value= "${version.id}-${DSTAMP}" />
<attribute name= "Implementation-Vendor" value= "Apache" />
</section>
</manifest>
</jar>
2003-04-23 20:53:41 -04:00
</target>
<target name= "dist" depends= "compile,site,jar" description= "Creates the entire distribution into build/dist" >
<zip destfile= "${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.zip" >
<zipfileset dir= "${build.site}" prefix= "docs" />
2003-05-17 01:43:08 -04:00
<zipfileset file= "${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" />
<zipfileset file= "${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" />
<zipfileset file= "${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" />
<zipfileset dir= "legal" prefix= "legal" />
2003-04-23 20:53:41 -04:00
</zip>
<zip destfile= "${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.zip" >
<zipfileset dir= "${build.site}" prefix= "docs" />
<zipfileset dir= "." >
<exclude name= "build/**" />
<exclude name= "scripts/**" />
<exclude name= "*.ipr" />
<exclude name= "*.iml" />
<exclude name= "*.iws" />
</zipfileset>
</zip>
<tar destfile= "${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.tar.gz" compression= "gzip" >
<tarfileset dir= "${build.site}" prefix= "docs" />
2003-07-14 08:11:12 -04:00
<tarfileset file= "${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar" />
<tarfileset file= "${dist.dir}/${jar.name}-contrib-${version.id}-${DSTAMP}.jar" />
<tarfileset file= "${dist.dir}/${jar.name}-scratchpad-${version.id}-${DSTAMP}.jar" />
2003-05-17 01:43:08 -04:00
<tarfileset dir= "legal" prefix= "legal" />
2003-04-23 20:53:41 -04:00
</tar>
<tar destfile= "${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.tar.gz" compression= "gzip" >
<tarfileset dir= "${build.site}" prefix= "docs" />
<tarfileset dir= "." >
<exclude name= "build/**" />
<exclude name= "scripts/**" />
<exclude name= "*.ipr" />
<exclude name= "*.iml" />
<exclude name= "*.iws" />
</tarfileset>
</tar>
<echo > Distribution located in build/dist</echo>
</target>
2003-08-23 15:07:41 -04:00
<target name= "clean-compile" depends= "clean,compile" />
2004-12-31 08:26:31 -05:00
<target name= "clean-dist" depends= "clean,dist"
description="Cleans the build directory then creates a distribution"/>
2003-04-23 20:53:41 -04:00
2003-07-14 08:14:18 -04:00
<target name= "gump" depends= "test,jar" />
2003-05-09 07:09:51 -04:00
2004-12-31 08:26:31 -05:00
<!-- Generates the ANT document type definition (DTD) -->
<target name= "dtd"
2005-01-01 18:39:42 -05:00
description="Generates the Ant document type definition (DTD)">
2004-12-31 08:26:31 -05:00
<antstructure output= "ant.dtd" />
</target>
<!-- Still experimental targets: -->
2005-01-01 18:39:42 -05:00
<!-- Abort the build if JUnit is missing. -->
2004-12-31 08:26:31 -05:00
<target name= "is-available-junit" depends= "init" >
<condition property= "isAvailable.junit" >
<available classname= "junit.framework.TestCase" />
</condition>
<antcall target= "check-junit" />
</target>
<target name= "check-junit" unless= "isAvailable.junit" >
<echo >
JUnit is not available. You must download JUnit from
< http://www.junit.org/> and include the JAR file in your
2005-01-01 18:39:42 -05:00
classpath.
2004-12-31 08:26:31 -05:00
</echo>
2005-01-01 18:39:42 -05:00
<fail message= "JUnit is not available." />
2004-12-31 08:26:31 -05:00
</target>
2005-01-01 18:39:42 -05:00
<!-- Abort the build if JDepend is missing. -->
2004-12-31 08:26:31 -05:00
<target name= "is-available-jdepend" depends= "init" >
<condition property= "isAvailable.jdepend" >
<available classname= "jdepend.framework.JDepend" />
</condition>
<antcall target= "check-jdepend" />
</target>
<target name= "check-jdepend" unless= "isAvailable.jdepend" >
<echo >
JDepend is not available. You must download JDepend from
< http://www.clarkware.com/software/JDepend.html> and include the
2005-01-01 18:39:42 -05:00
JAR file in your classpath.
</echo>
<fail message= "JDepend is not available." />
</target>
<!-- Abort the build if the Xalan XSLT processor is missing. The
"junitreport" task seems to explicitly require Xalan instead of being
able to cope with any XSLT processor. -->
<target name= "is-available-xslt" depends= "init" >
<condition property= "isAvailable.xslt" >
<and >
<available
classname="javax.xml.transform.TransformerFactory"/>
<available
classname="org.apache.xalan.processor.TransformerFactoryImpl"/>
</and>
</condition>
<antcall target= "check-xslt" />
</target>
<target name= "check-xslt" unless= "isAvailable.xslt" >
<echo >
The Xalan XSLT processor is not available. You must download Xalan from
< http://xml.apache.org/xalan-j/> and include the JAR file in your
classpath.
2004-12-31 08:26:31 -05:00
</echo>
2005-01-01 18:39:42 -05:00
<fail message= "The Xalan XSLT processor is not available." />
2004-12-31 08:26:31 -05:00
</target>
2005-01-01 18:39:42 -05:00
<!-- Runs jdepend to produce a report about package dependencies -->
2004-12-31 08:26:31 -05:00
<target name= "jdepend" depends= "is-available-jdepend"
description="Runs jdepend to produce a report about package dependencies">
<jdepend outputfile= "${jdepend.report.dir}/jdepend.xml" format= "xml" >
<classespath >
<pathelement location= "${main.output.dir}" />
<pathelement location= "${contrib.output.dir}" />
<pathelement location= "${scratchpad.output.dir}" />
</classespath>
<classpath >
<path refid= "main.classpath" />
<path refid= "contrib.classpath" />
<path refid= "scratchpad.classpath" />
</classpath>
</jdepend>
<style basedir= "${jdepend.report.dir}"
in="${jdepend.report.dir}/jdepend.xml"
out="${jdepend.report.out.dir}/index.html"
style="jdepend.xsl"/>
</target>
2002-01-30 21:22:28 -05:00
</project>
2004-12-31 08:26:31 -05:00
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->