- Before running the "test" or "reports" target Ant now checks whether JUnit and JDepend are available, i.e. included in the classpath.

- Started to modularize the "reports" target into independend subtargets in order to make it possible to run "ant jdepend", "ant javadocs" etc. individually.
- Fixed the "jdepend" task so that it runs with JDepend 3.9.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Klute 2004-12-31 13:26:31 +00:00
parent 600686a4ca
commit 241a378dc1
1 changed files with 141 additions and 90 deletions

231
build.xml
View File

@ -7,10 +7,14 @@
Glen Stampoultzis glens at apache.org Glen Stampoultzis glens at apache.org
Modified by:
This build was tested with ant 1.5.3 although it will probably work with Rainer Klute klute@rainer-klute.de
other versions. The following jar files should be installed
into the ant lib directory:
This build was tested with ant 1.6.2 although it will probably work with
other versions. The following jar files should be available on the -->
classpath when running ant:
LIBRARY LOCATION LIBRARY LOCATION
======= ======== ======= ========
@ -130,7 +134,7 @@ Main targets:
debug-test Runs a single test case specified with debug-test Runs a single test case specified with
-Dtestcase=classname with remote debug -Dtestcase=classname with remote debug
options turned on. options turned on.
reports Creates junit,jdepend and javadoc reports reports Creates junit, jdepend and javadoc reports
site Generates the documentation and reports site Generates the documentation and reports
dist Creates the entire distribution into build/dist dist Creates the entire distribution into build/dist
clean-dist Cleans the build directory then creates a clean-dist Cleans the build directory then creates a
@ -213,9 +217,7 @@ Main targets:
</target> </target>
<target name="compile" depends="init,compile-main,compile-scratchpad,compile-contrib" <target name="compile" depends="init,compile-main,compile-scratchpad,compile-contrib"
description="Compiles the POI classes"> description="Compiles the POI classes"/>
</target>
<target name="compile-main" depends="init"> <target name="compile-main" depends="init">
<copy todir="${main.output.dir}"> <copy todir="${main.output.dir}">
@ -275,7 +277,11 @@ Main targets:
<pathelement location="${main.output.test.dir}"/> <pathelement location="${main.output.test.dir}"/>
<pathelement location="${junit.jar1.dir}"/> <pathelement location="${junit.jar1.dir}"/>
</path> </path>
<target name="test-main" depends="compile-main,-test-main-check" unless="main.test.notRequired">
<target
name="test-main"
depends="compile-main, -test-main-check, is-available-junit"
unless="main.test.notRequired">
<junit printsummary="no" showoutput="true" fork="no" <junit printsummary="no" showoutput="true" fork="no"
haltonfailure="${halt.on.test.failure}" failureproperty="main.test.failed"> haltonfailure="${halt.on.test.failure}" failureproperty="main.test.failed">
<classpath refid="test.classpath"/> <classpath refid="test.classpath"/>
@ -430,14 +436,17 @@ FORREST_HOME environment variable!</echo>
<copy todir="${build.site.src}/src/documentation/content/apidocs"> <copy todir="${build.site.src}/src/documentation/content/apidocs">
<fileset dir="${apidocs.report.dir}"/> <fileset dir="${apidocs.report.dir}"/>
</copy> </copy>
<copy tofile="${build.site.src}/src/documentation/content/jdepend.ehtml" file="${jdepend.report.dir}/index.html" failonerror="false"/> <copy
tofile="${build.site.src}/src/documentation/content/jdepend.ehtml"
file="${jdepend.report.dir}/index.html" failonerror="false"/>
<mkdir dir="${build.site.src}/src/documentation/content/junit"/> <mkdir dir="${build.site.src}/src/documentation/content/junit"/>
<copy todir="${build.site.src}/src/documentation/content/junit"> <copy todir="${build.site.src}/src/documentation/content/junit">
<fileset dir="${junit.report.dir}"/> <fileset dir="${junit.report.dir}"/>
</copy> </copy>
<move file="${build.site.src}/src/documentation/content/xdocs/status.xml" tofile="${build.site.src}/status.xml"/> <move
file="${build.site.src}/src/documentation/content/xdocs/status.xml"
tofile="${build.site.src}/status.xml"/>
<ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"> <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site">
<property name="project.home" location="${build.site.src}"/> <property name="project.home" location="${build.site.src}"/>
@ -474,88 +483,43 @@ FORREST_HOME environment variable!</echo>
</style> </style>
</target> </target>
<target name="reports" depends="-check-reports" unless="reports.notRequired" <!-- FIXME: This target has to be split into several targets so that each
description="Creates junit,jdepend and javadoc reports"> of them can be executed individually. -->
<antcall target="test"> <target name="reports"
<param name="halt.on.test.failure" value="false"/> depends="-check-reports, is-available-junit, is-available-jdepend"
</antcall> unless="reports.notRequired"
<junitreport todir="${junit.report.dir}"> description="Creates JUnit and JDepend reports and generates the API documentation">
<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>
<jdepend outputfile="${jdepend.report.dir}/jdepend.xml" format="xml"> <antcall target="test">
<sourcespath> <param name="halt.on.test.failure" value="false"/>
<pathelement location="${main.src}"/> </antcall>
<pathelement location="${contrib.src}"/>
<pathelement location="${scratchpad.src}"/>
</sourcespath>
<classpath>
<path refid="main.classpath"/>
<path refid="contrib.classpath"/>
<path refid="scratchpad.classpath"/>
<pathelement location="${main.output.dir}"/>
<pathelement location="${contrib.output.dir}"/>
<pathelement location="${scratchpad.output.dir}"/>
</classpath>
</jdepend>
<style basedir="${jdepend.report.dir}" <junitreport todir="${junit.report.dir}">
in="${jdepend.report.dir}/jdepend.xml" <fileset dir="${main.reports.test}">
out="${jdepend.report.out.dir}/index.html" <include name="TEST-*.xml"/>
style="jdepend.xsl"/> </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>
<antcall target="-cvschangelog"/> <antcall target="jdepend"/>
<javadoc <antcall target="-cvschangelog"/>
destdir="${apidocs.report.dir}"
author="true"
version="true"
use="true"
verbose="false"
windowtitle="POI API">
<packageset dir="${main.src}" defaultexcludes="yes"> <antcall target="javadocs"/>
<include name="org/apache/poi/**"/>
</packageset>
<packageset dir="${scratchpad.src}" defaultexcludes="yes">
<include name="org/apache/poi/**"/>
</packageset>
<packageset dir="${contrib.src}" defaultexcludes="yes">
<include name="org/apache/poi/**"/>
</packageset>
<classpath> <antcall target="clover.html"/>
<path refid="main.classpath"/>
<path refid="scratchpad.classpath"/>
<path refid="contrib.classpath"/>
</classpath>
<doctitle><![CDATA[<h1>POI Documentation</h1>]]></doctitle> </target>
<bottom><![CDATA[<i>Copyright &#169; 2003 Apache Software Foundation.</i>]]></bottom>
<group title="HSSF" packages="org.apache.poi.hssf*"/>
<group title="HPSF" packages="org.apache.poi.hpsf*"/>
<group title="POIFS" packages="org.apache.poi.poifs*"/>
<group title="HDF" packages="org.apache.poi.hdf*"/>
<group title="Record Generator" packages="org.apache.poi.record*"/>
<group title="Utils" packages="org.apache.poi.util*"/>
</javadoc>
<antcall target="clover.html"/>
</target>
<target name="javadocs" description="Generate javadocs"> <target name="javadocs" description="Generates the API documentation">
<javadoc <javadoc
destdir="${apidocs.report.dir}" destdir="${apidocs.report.dir}"
author="true" author="true"
@ -565,19 +529,19 @@ FORREST_HOME environment variable!</echo>
windowtitle="POI API"> windowtitle="POI API">
<packageset dir="${main.src}" defaultexcludes="yes"> <packageset dir="${main.src}" defaultexcludes="yes">
<include name="org/apache/poi/**"/> <include name="org/apache/poi/**"/>
</packageset> </packageset>
<packageset dir="${scratchpad.src}" defaultexcludes="yes"> <packageset dir="${scratchpad.src}" defaultexcludes="yes">
<include name="org/apache/poi/**"/> <include name="org/apache/poi/**"/>
</packageset> </packageset>
<packageset dir="${contrib.src}" defaultexcludes="yes"> <packageset dir="${contrib.src}" defaultexcludes="yes">
<include name="org/apache/poi/**"/> <include name="org/apache/poi/**"/>
</packageset> </packageset>
<classpath> <classpath>
<path refid="main.classpath"/> <path refid="main.classpath"/>
<path refid="scratchpad.classpath"/> <path refid="scratchpad.classpath"/>
<path refid="contrib.classpath"/> <path refid="contrib.classpath"/>
</classpath> </classpath>
<doctitle><![CDATA[<h1>POI Documentation</h1>]]></doctitle> <doctitle><![CDATA[<h1>POI Documentation</h1>]]></doctitle>
@ -730,8 +694,95 @@ FORREST_HOME environment variable!</echo>
<target name="clean-compile" depends="clean,compile"/> <target name="clean-compile" depends="clean,compile"/>
<target name="clean-dist" depends="clean,dist" description="Cleans the build directory then creates a distribution"/> <target name="clean-dist" depends="clean,dist"
description="Cleans the build directory then creates a distribution"/>
<target name="gump" depends="test,jar"/> <target name="gump" depends="test,jar"/>
<!-- Generates the ANT document type definition (DTD) -->
<target name="dtd"
description="Generates the ANT document type definition (DTD)">
<antstructure output="ant.dtd"/>
</target>
<!-- Still experimental targets: -->
<target name="is-available-junit" depends="init">
<condition property="isAvailable.junit">
<available classname="junit.framework.TestCase"/>
</condition>
<antcall target="check-junit"/>
</target>
<!-- Abort the build because JUnit is missing. -->
<target name="check-junit" unless="isAvailable.junit">
<echo>
JUnit is not available. You must download JUnit from
&lt;http://www.junit.org/&gt; and include the JAR file in your
classpath."
</echo>
<fail message="JUnit is not available." unless="available.junit"/>
</target>
<target name="is-available-jdepend" depends="init">
<condition property="isAvailable.jdepend">
<available classname="jdepend.framework.JDepend"/>
</condition>
<antcall target="check-jdepend"/>
</target>
<!-- Abort the build because JDepend is missing. -->
<target name="check-jdepend" unless="isAvailable.jdepend">
<echo>
JDepend is not available. You must download JDepend from
&lt;http://www.clarkware.com/software/JDepend.html&gt; and include the
JAR file in your classpath."
</echo>
<fail message="JDepend is not available." unless="available.jdepend"/>
</target>
<!-- FIXME: Make target "reports" depend on this! -->
<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>
</project> </project>
<!-- 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:
-->