blob: 2da41241a8a6043b1dea2958a4cf88ce09e08922 [file] [log] [blame]
<?xml version="1.0"?>
<!-- $Id$ -->
<!-- Top-level buildfile for the Tapestry module. -->
<project name="Tapestry Web Application Framework" default="install">
<property name="root.dir" value="./"/>
<property name="config.dir" value="${root.dir}/config"/>
<property file="${config.dir}/Version.properties"/>
<property file="${config.dir}/build.properties"/>
<property file="${config.dir}/common.properties"/>
<property name="javadoc.dir" value="web/doc/api"/>
<property name="private.dir" value="private"/>
<!-- Forrest prefers to put stuff in here. -->
<property name="build.dir" value="build"/>
<property environment="env"/>
<path id="jetty.classpath">
<fileset dir="${jetty.dir}">
<include name="lib/javax.servlet.jar"/>
<include name="lib/org.mortbay.jetty.jar"/>
<include name="ext/*.jar"/>
</fileset>
<!-- Needed to support JSP compilation -->
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
</path>
<path id="ext.dist.classpath">
<fileset dir="${ext.dist.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="workbench.classpath">
<fileset dir="${root.lib.dir}">
<include name="${framework.jar}"/>
<include name="${contrib.jar}"/>
<include name="${ext.dir}/*.jar"/>
<include name="${runtime.dir}/*.jar"/>
</fileset>
<pathelement location="config"/>
</path>
<path id="vlib.classpath">
<pathelement location="${vlibbeans.jar}"/>
<pathelement location="tapestry-examples/VlibBeans/jboss"/>
<pathelement location="${jboss.client.dir}/jboss-j2ee.jar"/>
<pathelement location="${jboss.client.dir}/jboss-client.jar"/>
<pathelement location="${jboss.client.dir}/jnp-client.jar"/>
<path refid="workbench.classpath"/>
</path>
<target name="clean" description="Cleans all sub-projects.">
<ant dir="framework" target="clean"/>
<ant dir="contrib" target="clean"/>
<ant dir="junit" target="clean"/>
<ant dir="tapestry-examples" target="clean"/>
<ant dir="doc/src" target="clean"/>
<delete dir="${private.dir}" quiet="true"/>
</target>
<target name="clean-all" depends="clean"
description="Cleans all subprojects and deletes installed frameworks, WARs and generated documentation."
>
<delete quiet="true">
<fileset dir="${root.lib.dir}">
<include name="*.jar"/>
<include name="examples/**"/>
</fileset>
</delete>
<delete dir="web/doc" quiet="true"/>
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="install" description="Builds all frameworks and examples."
depends="download-ext-install">
<!-- Each project has its own definitions for many properties.
inheritAll="false" ensures that definitions in this buildfile
doesn't override definitions in each project's buildfile. -->
<ant dir="framework" target="install" inheritAll="false"/>
<ant dir="contrib" target="install" inheritAll="false"/>
<ant dir="tapestry-examples" target="install" inheritAll="false"/>
</target>
<target name="build-workbench" description="Builds and installs the Workbench demo."
depends="download-ext-framework">
<ant dir="tapestry-examples/tapestry-workbench" target="install" inheritAll="false"/>
</target>
<target name="build-vlib" description="Builds and installs the Virtual Library demo."
depends="download-ext-framework,check-for-jboss-dir">
<ant dir="tapestry-examples/VlibBeans" target="install" inheritAll="false"/>
<ant dir="tapestry-examples/Vlib" target="install" inheritAll="false"/>
<ant dir="tapestry-examples/VlibEAR" target="install" inheritAll="false"/>
</target>
<target name="documentation" depends="download-ext-doc"
description="Builds the Tapestry documentation.">
<ant dir="doc/src" target="install" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
<echo>Building site documentation using Forrest ...</echo>
<antcall target="site" inheritall="true"/>
</target>
<target name="junit" depends="check-for-jython-dir,download-ext-junit"
description="Run the JUnit test suite for Tapestry.">
<ant dir="junit" target="run" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
</target>
<target name="clover" depends="check-for-clover-dir,check-for-jython-dir"
description="Execute the JUnit tests and generate Code Coverage report."
>
<ant dir="junit" target="clover" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
</target>
<target name="dist"
description="Builds the Tapestry distribution from scratch."
depends="clean-all,install,junit,documentation,clover,javadoc">
<!-- After building, clean all the subprojects. -->
<antcall target="clean"/>
<!-- Now, build that actual distribution. -->
<antcall target="build-dist"/>
</target>
<property name="dist.root.dir" value="dist"/>
<property name="dist.base" value="Tapestry-${framework.version}"/>
<property name="dist.dir" value="${dist.root.dir}/${dist.base}"/>
<target name="build-dist"
description="Builds the Tapestry distribution files.">
<!-- Delete the base directory. -->
<delete dir="${dist.root.dir}" quiet="true"/>
<antcall target="build-dist-tarball"/>
</target>
<target name="build-dist-copy">
<echo>Copying to ${dist.dir} ...</echo>
<!-- Copy all the relevant files to the base directory. -->
<echo> Copying documentation ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="build.xml"/>
<include name="*.html"/>
<include name="*.txt"/>
<include name="KEYS"/>
<!-- Skip HTML files in web, since those need
a seperate path, to provide filtering. -->
<exclude name="Readme.html"/>
<include name="config/**"/>
<include name="ext-dist/README.html"/>
<exclude name="lib/*"/>
<exclude name="lib/**"/>
<!-- Exclude Paint Shop Pro files (used to generate images
in various places) -->
<exclude name="**/*.psp"/>
<exclude name="**/*.jbf"/>
<!-- Don't include build.properties; that's specific to this build
environment. We ship a sample file instead. -->
<exclude name="config/build.properties"/>
<!-- This is where Eclipse puts classes. -->
<exclude name="bin/**"/>
<exclude name="${build.dir}"/>
<!-- It isn't a good idea to generate a distribution from a normal working
directory, since the <copy> will include things like backup files created
while editting. Better to check out the Tapestry module via anon CVS to
a temporary directory, configure build.properties, and build the
release there. -->
</fileset>
</copy>
<!-- The Readme.html file and several of the web pages
include a version number; copy w/ filtering. -->
<echo> Copying (and filtering) Readme.html ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="Readme.html"/>
</fileset>
<filterset>
<filter token="VERSION" value="${framework.version}"/>
<filter token="OS_NAME" value="${os.name}"/>
<filter token="OS_VERSION" value="${os.version}"/>
<filter token="JAVA_VENDOR" value="${java.vendor}"/>
<filter token="JAVA_VM_VERSION" value="${java.vm.version}"/>
<filter token="COPY_YEARS" value="${copyright.years}"/>
<filter token="HOME_PAGE_URL"
value="http://jakarta.apache.org/tapestry"/>
<filter token="OGNL_VERSION" value="${ognl.version}"/>
<filter token="JAVASSIST_VERSION" value="${javassist.version}"/>
</filterset>
</copy>
<echo> Copying compiled and redistributable libraries ...</echo>
<copy todir="${dist.dir}/lib">
<fileset dir="${root.lib.dir}">
<include name="**/*.jar"/>
<exclude name="examples/*"/>
<exclude name="${ext.dir}/ognl-*.jar"/>
<exclude name="${ext.dir}/javassist-*.jar"/>
<include name="**/LICENSE*"/>
</fileset>
</copy>
<echo> Copying Tapestry Tag Library Descriptor ...</echo>
<copy
file="framework/META-INF/taglib.tld"
tofile="${dist.dir}/lib/tapestry-${framework.version}.tld"/>
<echo> Copying framework and examples source code ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="framework/**"/>
<include name="contrib/**"/>
<include name="examples/**"/>
<!-- These two aren't quite ready for primetime. -->
<exclude name="examples/DevelopmentEnvironment/**"/>
<exclude name="examples/Tutorial2/**"/>
<!-- These are thumnail files that turn up in directories that contain images. These
are not stored in CVS and should not be part of the distribution. -->
<exclude name="**/Thumbs.db"/>
<exclude name="**/pspbrwse.jbf"/>
<exclude name="**/classes/"/>
</fileset>
</copy>
<property name="web.dir" value="${dist.dir}/web"/>
<property name="dtd.dir" value="${web.dir}/dtd"/>
<echo> Copying Tapestry DTDs ...</echo>
<copy todir="${dtd.dir}" flatten="true">
<fileset dir="framework/src">
<include name="**/*.dtd"/>
</fileset>
</copy>
<!-- Copy over javadoc, component references, and docs generated from docbook.
We tend to copy the same files too many times (i.e., the builds for the
TapestryUsersGuide could generate the HTML files directly into the dist), but
it's still fast *enough* so not to fiddle. -->
<echo> Copying documentation, JavaDoc, Clover report ...</echo>
<copy todir="${web.dir}" includeEmptyDirs="false">
<fileset dir="web">
<!-- Exclude the top level stuff (any remnants of the old, static web site).
Include all the docs and reports generated below. -->
<exclude name="*.html"/>
<include name="**/*"/>
</fileset>
<fileset dir="${build.dir}/site"/>
</copy>
</target>
<target name="build-dist-tarball"
description="Builds the tarball distributions."
depends="build-dist-copy">
<property name="bin.tar.gz" value="${dist.dir}-bin.tar.gz"/>
<property name="src.tar.gz" value="${dist.dir}-src.tar.gz"/>
<tar tarfile="${bin.tar.gz}" longfile="gnu" compression="gzip">
<tarfileset dir="${dist.root.dir}" id="dist.bin.set">
<include name="${dist.base}/*"/>
<include name="${dist.base}/config/**"/>
<include name="${dist.base}/lib/**"/>
<!-- Have to include a lot of Workbench source in the binary distro, because
it has to be compiled and built using the dynamically downloaded non-ASL
libraries (such as OGNL). -->
<include name="${dist.base}/examples/Workbench/**"/>
<exclude name="${dist.base}/examples/Workbench/.build/**"/>
<exclude name="${dist.base}/examples/Workbench/image-src/**"/>
<include name="${dist.base}/examples/Vlib/**"/>
<include name="${dist.base}/examples/VlibBeans/**"/>
<include name="${dist.base}/examples/VlibEAR/**"/>
<include name="${dist.base}/examples/wap/**"/>
<include name="${dist.base}/examples/build.xml"/>
<!-- Don't ship the code coverage report; it's huge. -->
<include name="${dist.base}/web/**"/>
<exclude name="${dist.base}/web/doc/clover/**"/>
</tarfileset>
</tar>
<tar tarfile="${src.tar.gz}" longfile="gnu" compression="gzip">
<tarfileset dir="${dist.root.dir}" id="dist.src.set">
<!-- Include the sub-projects excluded from the -bin distro. -->
<include name="${dist.base}/framework/**"/>
<include name="${dist.base}/contrib/**"/>
</tarfileset>
</tar>
<property name="bin.zip" value="${dist.dir}-bin.zip"/>
<property name="src.zip" value="${dist.dir}-src.zip"/>
<zip destfile="${bin.zip}">
<zipfileset refid="dist.bin.set"/>
</zip>
<zip destfile="${src.zip}">
<zipfileset refid="dist.src.set"/>
</zip>
<!-- Create the web distribution (to be put up on the web site). This *does*
include the code coverage report. -->
<property name="web.tar.gz"
value="${dist.root.dir}/Tapestry-Web-${framework.version}.tar.gz"/>
<tar basedir="${web.dir}" tarfile="${web.tar.gz}" longfile="gnu"
compression="gzip"/>
</target>
<target name="javadoc"
description="Generate API documentation for the framework and examples."
>
<mkdir dir="${javadoc.dir}"/>
<javadoc author="true" version="true" destdir="${javadoc.dir}"
splitindex="true" windowtitle="Tapestry API ${framework.version}">
<doctitle>Tapestry ${framework.version} API</doctitle>
<package name="org.apache.tapestry.*"/>
<link href="http://java.sun.com/j2se/1.3/docs/api/"
offline="true" packageListLoc="package-lists/jdk"/>
<link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"
offline="true" packageListLoc="package-lists/j2ee"/>
<link href="http://jakarta.apache.org/log4j/docs/api/"
offline="true" packageListLoc="package-lists/log4j"/>
<link href="http://www.junit.org/junit/javadoc/3.7/" offline="true"
packageListLoc="package-lists/junit"/>
<link href="http://jakarta.apache.org/oro/api/" offline="true"
packageListLoc="package-lists/jakarta-oro"/>
<group title="Tapestry Framework"
packages="org.apache.tapestry:org.apache.tapestry.*"/>
<group title="Tapestry Contributions Framework"
packages="org.apache.tapestry.contrib.*"/>
<sourcepath>
<pathelement location="framework/src"/>
<pathelement location="contrib/src"/>
</sourcepath>
<classpath>
<path refid="vlib.classpath"/>
<path refid="ext.dist.classpath"/>
<fileset dir="${root.lib.dir}">
<include name="${j2ee.dir}/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="run-workbench" depends="check-for-jetty-dir,build-workbench"
description="Runs the Tapestry Workbench using Jetty.">
<delete dir="${private.dir}" quiet="true"/>
<mkdir dir="${private.dir}"/>
<echo>Running Tapestry Workbench on port 8080 ...</echo>
<java classname="org.mortbay.jetty.Server" fork="true" maxmemory="128M">
<classpath>
<path refid="jetty.classpath"/>
</classpath>
<arg value="config/jetty-workbench.xml"/>
<!-- Enable debugging when running the tutorial -->
<jvmarg line="-showversion -Xdebug -Xnoagent"/>
<jvmarg
line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20150"
/>
<!-- Jetty can get easily confused (under NT) unless this is turned off. -->
<sysproperty key="org.mortbay.util.FileResource.checkAliases"
value="false"/>
<sysproperty key="org.apache.tapestry.asset.dir" value="${private.dir}"
/>
<sysproperty key="org.apache.tapestry.asset.URL" value="/private"/>
</java>
</target>
<!-- ===================================================================================
JBoss 3.0.6 auto configuration
Configures a JBoss 3.0.6 with a new configuration, tapestry. Part of the configuration
comes with the Tapestry distribution; part is copied from the JBoss default server
configuration.
This only works with JBoss 3.0.6; other releases differ enough that this
simple script is broken.
==================================================================================== -->
<property name="tapestry.dir" value="${jboss.dir}/server/tapestry"/>
<property name="tapestry.conf.dir" value="${tapestry.dir}/conf"/>
<property name="tapestry.lib.dir" value="${tapestry.dir}/lib"/>
<property name="tapestry.db.dir" value="${tapestry.dir}/db"/>
<property name="tapestry.deploy.dir" value="${tapestry.dir}/deploy"/>
<property name="tapestry.private.dir"
value="${tapestry.dir}/tmp/${private.dir}"/>
<property name="jboss.server.default.dir"
value="${jboss.dir}/server/default"/>
<target name="configure" depends="check-for-jboss-dir,download-ext-examples"
description="Configure the JBoss 3.0.6 server and setup the Tapestry database."
>
<delete dir="${tapestry.lib.dir}" quiet="true"/>
<mkdir dir="${tapestry.lib.dir}"/>
<copy todir="${tapestry.lib.dir}" flatten="true">
<fileset dir="${root.lib.dir}">
<include name="*-${framework.version}.jar"/>
<include name="${ext.dir}/*.jar"/>
</fileset>
<fileset dir="${ext.dist.dir}">
<include name="mckoidb*.jar"/>
</fileset>
<fileset dir="${jboss.server.default.dir}/lib">
<!-- Could do a careful analysis of just what we need and copy only that,
but this is good for now. -->
<include name="*.jar"/>
</fileset>
</copy>
<!-- Delete, recreate and copy -->
<delete dir="${tapestry.conf.dir}" quiet="true"/>
<mkdir dir="${tapestry.conf.dir}"/>
<copy todir="${tapestry.conf.dir}" filtering="true">
<fileset dir="config/jboss/conf"/>
<filterset>
<filter token="jboss.dir" value="${jboss.dir}"/>
<filter token="user.dir" value="${user.dir}"/>
</filterset>
</copy>
<mkdir dir="${tapestry.deploy.dir}"/>
<copy todir="${tapestry.deploy.dir}">
<fileset dir="${jboss.server.default.dir}/deploy">
<!-- Skip one file that is replaced -->
<exclude name="jbossweb.sar/META-INF/jboss-service.xml"/>
<include name="*"/>
<include name="**/*"/>
</fileset>
</copy>
<!-- Technically, this isn't necessary any longer (the filtering part),
but it does no harm, and may be needed again in the future. -->
<copy todir="${tapestry.deploy.dir}" filtering="true">
<fileset dir="config/jboss/deploy"/>
<filterset>
<filter token="user.dir" value="${user.dir}"/>
<filter token="jboss.dir" value="${jboss.dir}"/>
</filterset>
</copy>
<!-- Set a flag if the vlib already exists, then extract it if necessary. -->
<mkdir dir="${tapestry.db.dir}"/>
<available file="${tapestry.db.dir}/tapestry.conf"
property="tapestry.db.exists"/>
<antcall target="unpack-tapestry-database"/>
</target>
<target name="unpack-tapestry-database"
description="Unpacks the Tapestry demos database."
unless="tapestry.db.exists">
<unzip src="config/jboss/tapestry-db.zip" dest="${tapestry.db.dir}"/>
</target>
<target name="deploy-jboss-demos" depends="check-for-jboss-dir,build-workbench,build-vlib"
description="Deploys the demos and Tapestry frameworks into JBoss.">
<copy todir="${tapestry.deploy.dir}">
<fileset dir="${examples.dir}">
<include name="${vlib.ear}"/>
<include name="${workbench.war}"/>
</fileset>
</copy>
</target>
<target name="run-jboss" depends="deploy-jboss-demos"
description="Launch the JBoss application server.">
<delete dir="${tapestry.private.dir}" quiet="true"/>
<mkdir dir="${tapestry.private.dir}"/>
<java fork="true" dir="${jboss.dir}/bin" classname="org.jboss.Main">
<!-- Launch using the tapestry configuration, not the default. -->
<arg line="--configuration=tapestry"/>
<classpath>
<pathelement location="${jboss.dir}/bin/run.jar"/>
<!-- Include this so that the JMX control panel (based on JSPs) can work. -->
<pathelement location="${java.home}/../lib/tools.jar"/>
</classpath>
<!-- Enable debugging -->
<jvmarg line="-showversion -Xdebug -Xnoagent"/>
<jvmarg
line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20500"
/>
<!-- These allow private assets to be exported as static
files. This coordinates with portions of
config/deploy/jbossweb.sar/META-INF/jboss-service.xml -->
<sysproperty key="org.apache.tapestry.asset.dir"
value="${tapestry.private.dir}"/>
<sysproperty key="org.apache.tapestry.asset.URL" value="/private"/>
<!-- The following is probably only necessary under Windows. Jetty gets
tripped up by the fact that pathnames are case-insensitive. -->
<sysproperty key="org.mortbay.util.FileResource.checkAliases"
value="false"/>
</java>
</target>
<target name="deploy-tomcat"
depends="check-for-tomcat-dir,build-workbench"
description="Deploys the Workbench application into Tomcat.">
<copy file="${examples.dir}/${workbench.war}" todir="${tomcat.dir}/webapps"/>
</target>
<target name="check-for-jboss-dir">
<available property="exists.jboss.dir" type="dir" file="${jboss.dir}"/>
<fail unless="jboss.dir"
message="Property jboss.dir not specified in config/build.properties."
/>
<fail unless="exists.jboss.dir"
message="Directory ${jboss.dir} (jboss.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-tomcat-dir">
<available property="exists.tomcat.dir" type="dir" file="${tomcat.dir}"
/>
<fail unless="tomcat.dir"
message="Property tomcat.dir not specified in config/build.properties."
/>
<fail unless="exists.tomcat.dir"
message="Directory ${tomcat.dir} (tomcat.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-clover-dir">
<available property="exists.clover.dir" type="dir" file="${clover.dir}"
/>
<fail unless="clover.dir"
message="Property clover.dir not specified in config/build.properties."
/>
<fail unless="exists.clover.dir"
message="Directory ${clover.dir} (clover.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-jython-dir">
<available property="exists.jython.dir" type="dir" file="${jython.dir}"
/>
<fail unless="jython.dir"
message="Property jython.dir not specified in config/build.properties."
/>
<fail unless="exists.jython.dir"
message="Directory ${jython.dir} (jython.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-jetty-dir">
<available property="exists.jetty.dir" type="dir" file="${jetty.dir}" />
<fail unless="jetty.dir"
message="Property jetty.dir not specified in config/build.properties."
/>
<fail unless="exists.jetty.dir"
message="Directory ${jetty.dir} (jetty.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-forrest-dir" depends="check-defined-forrest-dir,check-downloaded-forrest">
</target>
<target name="site" description="Generates static HTML documentation" depends="check-for-forrest-dir">
<ant antfile="${installed.forrest.dir}/forrest.antproxy.xml" target="site">
<property name="forrest.home" value="${installed.forrest.dir}"/>
</ant>
</target>
<target name="validate" depends="check-for-forrest-dir" description="Validates XML documentation files">
<ant antfile="${installed.forrest.home}/forrest.antproxy.xml" target="validate"/>
</target>
<target name="check-defined-forrest-dir" if="forrest.dir">
<available property="exists.forrest.dir" type="dir" file="${forrest.dir}"/>
<fail unless="exists.forrest.dir"
message="Directory ${forrest.dir} (forrest.dir from config/build.properties) does not exist."/>
<property name="installed.forrest.dir" value="${forrest.dir}"/>
</target>
<target name="check-downloaded-forrest" unless="forrest.home" depends="proxyflags"
description="Download forrest package">
<echo message="Property forrest.dir not specified in config/build.properties"/>
<echo message="Downloading Forrest"/>
<antcall target="downloadzip">
<param name="sourcefile" value="${forrestdl.loc}"/>
<param name="dlfile" value="${forrestdl.ant.xml}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<property name="installed.forrest.dir" value="${forrestdl.home}"/>
</target>
<target name="download-ext-install"
depends="download-ext-framework, download-ext-examples"
description="Download binary packages for the install target"/>
<target name="download-ext-framework" depends="proxyflags"
description="Download binary packages for compiling the framework and examples" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installgz">
<param name="sourcefile" value="${jdom.loc}"/>
<param name="dlfile" value="${jdom.jar}"/>
<param name="destfile" value="${jdom.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<antcall target="installzip">
<param name="sourcefile" value="${javassist.loc}"/>
<param name="dlfile" value="${javassist.jar}"/>
<param name="destfile" value="${javassist.ext.jar}"/>
<param name="destdir" value="${javassist.dest}"/>
</antcall>
<antcall target="installjar">
<param name="sourcefile" value="${ognl.loc}"/>
<param name="destfile" value="${ognl.dest}"/>
</antcall>
</target>
<target name="download-ext-examples" depends="proxyflags"
description="Download binary packages for compiling the examples" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installzip">
<param name="sourcefile" value="${mckoi.loc}"/>
<param name="dlfile" value="${mckoi.jar}"/>
<param name="destfile" value="${mckoi.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
</target>
<target name="download-ext-junit" depends="proxyflags"
description="Download binary packages for compiling the unit tests" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installzip">
<param name="sourcefile" value="${junit.loc}"/>
<param name="dlfile" value="${junit.jar}"/>
<param name="destfile" value="${junit.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<antcall target="installgz">
<param name="sourcefile" value="${jdom.loc}"/>
<param name="dlfile" value="${jdom.jar}"/>
<param name="destfile" value="${jdom.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
</target>
<target name="download-ext-doc" depends="proxyflags"
description="Download binary packages for compiling the documentation" >
<mkdir dir="${ext.download.dir}" />
<antcall target="downloadfile">
<param name="sourcefile" value="${docbookxml.loc}"/>
<param name="destfile" value="${docbookxml.file}"/>
<param name="destdir" value="${ext.dist.dir}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${docbookxsl.loc}"/>
<param name="destfile" value="${docbookxsl.file}"/>
<param name="destdir" value="${ext.dist.dir}"/>
</antcall>
</target>
<target name="download-alert" unless="download-alert-shown">
<echo>
*********************************************************************************
* Due to the restrictions of the Apache Software License 2.0, it is necessary *
* to download some additional libraries that use non-ASL licenses. You should *
* be aware that redistribution of these files are regulated by their individual *
* licenses. If you experience problems with the download, consult the file *
* ext-dist/README.html for details on how to configure the build to work *
* around a firewall. *
*********************************************************************************
</echo>
<!-- This doesn't work so well ... the property must be getting lost after
each antcall completes. -->
<property name="download-alert-shown" value="you-betcha"/>
</target>
<target name="installjar" unless="exist" depends="setproxy,testexistdest,download-alert">
<get src="${sourcefile}" dest="${destfile}"/>
</target>
<target name="installgz" unless="exist" depends="setproxy,testexistdest">
<antcall target="downloadgz"/>
<copy file="${dlfile}" tofile="${destfile}"/>
</target>
<target name="downloadgz" unless="exist" depends="setproxy,testexist,download-alert">
<mkdir dir="${ext.download.dir}"/>
<!-- Download and extract the package -->
<get src="${sourcefile}" dest="${ext.download.dir}/file.tar.gz" />
<gunzip src="${ext.download.dir}/file.tar.gz" dest="${ext.download.dir}/file.tar"/>
<untar src="${ext.download.dir}/file.tar" dest="${ext.download.dir}"/>
<delete file="${ext.download.dir}/file.tar"/>
<delete file="${ext.download.dir}/file.tar.gz"/>
</target>
<target name="installzip" unless="exist" depends="setproxy,testexistdest">
<antcall target="downloadzip"/>
<copy file="${dlfile}" tofile="${destfile}"/>
</target>
<target name="downloadzip" unless="exist" depends="setproxy,testexist,download-alert">
<!-- Download and extract the package -->
<mkdir dir="${ext.download.dir}"/>
<get src="${sourcefile}" dest="${ext.download.dir}/file.zip" />
<mkdir dir="${destdir}" />
<unzip src="${ext.download.dir}/file.zip" dest="${destdir}"/>
<delete file="${ext.download.dir}/file.zip"/>
</target>
<target name="downloadfile" unless="exist" depends="setproxy,testexistdest">
<!-- Download extract the file -->
<mkdir dir="${destdir}" />
<get src="${sourcefile}" dest="${destfile}" />
</target>
<target name="proxyflags">
<!-- check proxy parameters. -->
<condition property="useproxy">
<equals arg1="${proxy.use}" arg2="on" />
</condition>
</target>
<target name="setproxy" if="useproxy">
<taskdef name="setproxy"
classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
<echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
</target>
<target name="testexistdest">
<echo message="Testing for ${destfile}"/>
<available file="${destfile}" property="exist"/>
</target>
<target name="testexist">
<echo message="Testing for ${dlfile}"/>
<available file="${dlfile}" property="exist"/>
</target>
</project>