- Performs checks for JDepend, JUnit and Xalan *before* doing long-running tasks.

- Included HWPS in the generated API documentation.
- Updated the copyright year to 2005.
- Target "reports" completely split into subtargets.
- Target "cvschangelog" is a main target now.
- Issue warning if CVS_RSH is not set.
- Minor build and documentation enhancements


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353621 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Klute 2005-01-01 23:39:42 +00:00
parent 96fe7f273b
commit f553b25f29

158
build.xml
View File

@ -117,31 +117,34 @@
<pathelement location="${contrib.output.test.dir}"/> <pathelement location="${contrib.output.test.dir}"/>
</path> </path>
<target name="help">
<echo>
Main targets:
compile Compiles the POI classes
test Tests main, contrib and scratchpad <!-- Prints POI's Ant usage help -->
jar Creates jar files for distribution <target name="help" description="Prints POI's Ant usage help">
docs Builds the POI website <echo>
fetch-jars Fetches needed JAR files from the Internet - Execute "ant -projecthelp" to view a listing of the main build
generate-records Generates HSSF records targets.
generate-types Generates word types - Execute "ant help-properties" to view a listing of some properties
javadocs Generate javadocs controlling the build process.
single-test Runs a single test case specified with
-Dtestcase=classname
debug-test Runs a single test case specified with
-Dtestcase=classname with remote debug
options turned on.
reports Creates junit, jdepend and javadoc reports
site Generates the documentation and reports
dist Creates the entire distribution into build/dist
clean-dist Cleans the build directory then creates a
distribution
</echo> </echo>
</target> </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>
<target name="with.clover" if="clover.present"> <target name="with.clover" if="clover.present">
<taskdef resource="clovertasks"/> <taskdef resource="clovertasks"/>
<clover-setup initString="mycoverage.db"/> <clover-setup initString="mycoverage.db"/>
@ -471,7 +474,12 @@ FORREST_HOME environment variable!</echo>
</condition> </condition>
</target> </target>
<target name="-cvschangelog" unless="disconnected">
<!-- 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"/> <cvschangelog destfile="${changelog.file}" daysinpast="30"/>
<style in="${changelog.file}" <style in="${changelog.file}"
@ -483,17 +491,37 @@ FORREST_HOME environment variable!</echo>
</style> </style>
</target> </target>
<!-- FIXME: This target has to be split into several targets so that each <target name="cvs-rsh-warning" unless="env.CVS_RSH">
of them can be executed individually. --> <echo>
<target name="reports" WARNING: The environment variable CVS_RSH is not set. If you cannot
depends="-check-reports, is-available-junit, is-available-jdepend" access the CVS repository this could be one of the reasons for the
unless="reports.notRequired" failure.
description="Creates JUnit and JDepend reports and generates the API documentation"> </echo>
</target>
<!-- Creates reports and API documentation -->
<target name="reports" unless="reports.notRequired" depends="-check-reports,
is-available-xslt, is-available-junit, is-available-jdepend,
test-ignore-failures, jdepend, cvschangelog, javadocs, clover.html"
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">
<antcall target="test"> <antcall target="test">
<param name="halt.on.test.failure" value="false"/> <param name="halt.on.test.failure" value="false"/>
</antcall> </antcall>
</target>
<!-- 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">
<junitreport todir="${junit.report.dir}"> <junitreport todir="${junit.report.dir}">
<fileset dir="${main.reports.test}"> <fileset dir="${main.reports.test}">
<include name="TEST-*.xml"/> <include name="TEST-*.xml"/>
@ -506,19 +534,11 @@ FORREST_HOME environment variable!</echo>
</fileset> </fileset>
<report format="frames" todir="${junit.report.dir}"/> <report format="frames" todir="${junit.report.dir}"/>
</junitreport> </junitreport>
<antcall target="jdepend"/>
<antcall target="-cvschangelog"/>
<antcall target="javadocs"/>
<antcall target="clover.html"/>
</target> </target>
<!-- Generates the API documentation. -->
<target name="javadocs" description="Generates the API documentation"> <target name="javadocs" description="Generates the API documentation">
<javadoc <javadoc
destdir="${apidocs.report.dir}" destdir="${apidocs.report.dir}"
@ -545,11 +565,14 @@ FORREST_HOME environment variable!</echo>
</classpath> </classpath>
<doctitle><![CDATA[<h1>POI Documentation</h1>]]></doctitle> <doctitle><![CDATA[<h1>POI Documentation</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2003 Apache Software Foundation.</i>]]></bottom> <bottom>
<group title="HSSF" packages="org.apache.poi.hssf*"/> <![CDATA[<i>Copyright &#169; 2005 Apache Software Foundation.</i>]]>
<group title="HPSF" packages="org.apache.poi.hpsf*"/> </bottom>
<group title="POIFS" packages="org.apache.poi.poifs*"/>
<group title="HDF" packages="org.apache.poi.hdf*"/> <group title="HDF" packages="org.apache.poi.hdf*"/>
<group title="HPSF" packages="org.apache.poi.hpsf*"/>
<group title="HSSF" packages="org.apache.poi.hssf*"/>
<group title="HWPF" packages="org.apache.poi.hwpf*"/>
<group title="POIFS" packages="org.apache.poi.poifs*"/>
<group title="Record Generator" packages="org.apache.poi.record*"/> <group title="Record Generator" packages="org.apache.poi.record*"/>
<group title="Utils" packages="org.apache.poi.util*"/> <group title="Utils" packages="org.apache.poi.util*"/>
</javadoc> </javadoc>
@ -603,8 +626,13 @@ FORREST_HOME environment variable!</echo>
</target> </target>
<!-- Generates documentation and reports -->
<target name="site" depends="reports, docs" <target name="site" depends="reports, docs"
description="Generates the documentation and reports"/> description="Generates POI's website's contents"/>
<target name="jar" depends="compile" description="Creates jar files for distribution"> <target name="jar" depends="compile" description="Creates jar files for distribution">
<jar basedir="${main.output.dir}" destfile="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar"> <jar basedir="${main.output.dir}" destfile="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar">
@ -703,7 +731,7 @@ FORREST_HOME environment variable!</echo>
<!-- Generates the ANT document type definition (DTD) --> <!-- Generates the ANT document type definition (DTD) -->
<target name="dtd" <target name="dtd"
description="Generates the ANT document type definition (DTD)"> description="Generates the Ant document type definition (DTD)">
<antstructure output="ant.dtd"/> <antstructure output="ant.dtd"/>
</target> </target>
@ -711,6 +739,7 @@ FORREST_HOME environment variable!</echo>
<!-- Still experimental targets: --> <!-- Still experimental targets: -->
<!-- Abort the build if JUnit is missing. -->
<target name="is-available-junit" depends="init"> <target name="is-available-junit" depends="init">
<condition property="isAvailable.junit"> <condition property="isAvailable.junit">
<available classname="junit.framework.TestCase"/> <available classname="junit.framework.TestCase"/>
@ -718,16 +747,18 @@ FORREST_HOME environment variable!</echo>
<antcall target="check-junit"/> <antcall target="check-junit"/>
</target> </target>
<!-- Abort the build because JUnit is missing. -->
<target name="check-junit" unless="isAvailable.junit"> <target name="check-junit" unless="isAvailable.junit">
<echo> <echo>
JUnit is not available. You must download JUnit from JUnit is not available. You must download JUnit from
&lt;http://www.junit.org/&gt; and include the JAR file in your &lt;http://www.junit.org/&gt; and include the JAR file in your
classpath." classpath.
</echo> </echo>
<fail message="JUnit is not available." unless="available.junit"/> <fail message="JUnit is not available."/>
</target> </target>
<!-- Abort the build if JDepend is missing. -->
<target name="is-available-jdepend" depends="init"> <target name="is-available-jdepend" depends="init">
<condition property="isAvailable.jdepend"> <condition property="isAvailable.jdepend">
<available classname="jdepend.framework.JDepend"/> <available classname="jdepend.framework.JDepend"/>
@ -735,17 +766,44 @@ FORREST_HOME environment variable!</echo>
<antcall target="check-jdepend"/> <antcall target="check-jdepend"/>
</target> </target>
<!-- Abort the build because JDepend is missing. -->
<target name="check-jdepend" unless="isAvailable.jdepend"> <target name="check-jdepend" unless="isAvailable.jdepend">
<echo> <echo>
JDepend is not available. You must download JDepend from JDepend is not available. You must download JDepend from
&lt;http://www.clarkware.com/software/JDepend.html&gt; and include the &lt;http://www.clarkware.com/software/JDepend.html&gt; and include the
JAR file in your classpath." JAR file in your classpath.
</echo> </echo>
<fail message="JDepend is not available." unless="available.jdepend"/> <fail message="JDepend is not available."/>
</target> </target>
<!-- FIXME: Make target "reports" depend on this! -->
<!-- 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
&lt;http://xml.apache.org/xalan-j/&gt; and include the JAR file in your
classpath.
</echo>
<fail message="The Xalan XSLT processor is not available."/>
</target>
<!-- Runs jdepend to produce a report about package dependencies -->
<target name="jdepend" depends="is-available-jdepend" <target name="jdepend" depends="is-available-jdepend"
description="Runs jdepend to produce a report about package dependencies"> description="Runs jdepend to produce a report about package dependencies">
<jdepend outputfile="${jdepend.report.dir}/jdepend.xml" format="xml"> <jdepend outputfile="${jdepend.report.dir}/jdepend.xml" format="xml">