@@ -23,48 +23,48 @@
-->
-->
<project name="fetch" default="all" basedir=".">
<project name="fetch" default="all" basedir=".">
<description>
This build file downloads JAR files that optional Ant tasks use,
and installs them in a location that is accessible the next time Ant runs.
<description>
This build file downloads JAR files that optional Ant tasks use,
and installs them in a location that is accessible the next time Ant runs.
You can choose three locations, by going -Ddest=LOCATION on the command line
-Ddest=user user lib dir ${user.home}/.ant/lib
-Ddest=system ant lib dir ${ant.home}/lib
-Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
You can choose three locations, by going -Ddest=LOCATION on the command line
-Ddest=user user lib dir ${user.home}/.ant/lib
-Ddest=system ant lib dir ${ant.home}/lib
-Ddest=optional optional dir $${basedir}/lib/optional (for Ant developers)
You may also need to set proxy settings. On Java1.5, Ant tries to get
this from the OS, unless you use the -noproxy option.
You may also need to set proxy settings. On Java 1.5, Ant tries to get
this from the OS, unless you use the -noproxy option.
Proxies can be configured manually setting the JVM proxy values in the
ANT_OPTS environment variable.
Proxies can be configured manually setting the JVM proxy values in the
ANT_OPTS environment variable.
For example, to set the proxy up in the tcsh shell, the command would be
something like:
For example, to set the proxy up in the tcsh shell, the command would
be something like:
For csh/tcsh:
setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
For bash:
export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
For Windows, set the environment variable in the appropriate dialog box
and open a new console. or, by hand
set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
</description>
For csh/tcsh:
setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
For bash:
export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
For Windows, set the environment variable in the appropriate dialog box
and open a new console. or, by hand
set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
</description>
<!-- Give user a chance to override without editing this file
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
(and without typing -D each time it compiles it) -->
<property file="${user.home}/.ant/ant.properties"/>
<property file="${user.home}/.ant/ant.properties"/>
<property name="lib.dir" location="lib" />
<property name="optional.dir" location="${lib.dir}/optional" />
<property name="userlib.dir" location="${user.home}/.ant/lib" />
<property name="lib.dir" location="lib"/>
<property name="optional.dir" location="${lib.dir}/optional"/>
<property name="userlib.dir" location="${user.home}/.ant/lib"/>
<!-- l oad in our properties table -->
<!-- L oad in our properties table -->
<property file="${lib.dir}/libraries.properties"/>
<property file="${lib.dir}/libraries.properties"/>
<!-- Temporary cache for working files -->
<!-- Temporary cache for working files -->
<property name="temp.dir" location="${user.home}/.ant/tempcache" />
<property name="keep.temp.dir" value="true" />
<property name="temp.dir" location="${user.home}/.ant/tempcache"/>
<property name="keep.temp.dir" value="true"/>
<import file="get-m2.xml" />
<import file="get-m2.xml"/>
<target name="pick-dest">
<target name="pick-dest">
<fail>
<fail>
@@ -80,49 +80,57 @@ Set -Ddest=LOCATION on the command line
</fail>
</fail>
<condition property="dest.dir"
<condition property="dest.dir"
value="${lib.dir}">
<equals arg1="${dest}" arg2="system" />
value="${lib.dir}">
<equals arg1="${dest}" arg2="system"/>
</condition>
</condition>
<condition property="dest.dir"
<condition property="dest.dir"
value="${optional.dir}">
<equals arg1="${dest}" arg2="optional" />
value="${optional.dir}">
<equals arg1="${dest}" arg2="optional"/>
</condition>
</condition>
<condition property="dest.dir"
<condition property="dest.dir"
value="${userlib.dir}">
<equals arg1="${dest}" arg2="user" />
value="${userlib.dir}">
<equals arg1="${dest}" arg2="user"/>
</condition>
</condition>
<fail unless="dest.dir">Unknown destination : ${dest}</fail>
<fail unless="dest.dir">Unknown destination : ${dest}</fail>
<echo>Downloading to ${dest.dir}</echo>
<echo>Downloading to ${dest.dir}</echo>
<property name="m2.dest.dir" value="${dest.dir}" />
<property name="m2.dest.dir" value="${dest.dir}"/>
</target>
</target>
<target name="macros" depends="pick-dest,get-m2"
<target name="macros" depends="pick-dest,get-m2"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<fail>
Cannot execute multiple targets due to the bug in Maven Ant tasks
<condition>
<contains string="${ant.project.invoked-targets}" substring=","/>
</condition>
</fail>
<macrodef name="f2">
<macrodef name="f2">
<attribute name="project" />
<attribute name="project"/>
<attribute name="archive" default="@{project}"/>
<attribute name="archive" default="@{project}"/>
<attribute name="repository" default="${m2.repo}"/>
<attribute name="repository" default="${m2.repo}"/>
<sequential>
<sequential>
<fail>
<fail>
Unknown archive @{archive} -no property @{archive}.version defined in ${lib.dir}/libraries.properties.
Unknown archive @{archive} -no property @{archive}.version defined in ${lib.dir}/libraries.properties.
<condition>
<condition>
<not>
<not>
<isset property="@{archive}.version"/>
<isset property="@{archive}.version"/>
</not>
</not>
</condition>
</condition>
</fail>
</fail>
<artifact:dependencies pathID="@{archive}.path">
<dependency groupID="@{project}"
artifactID="@{archive}"
version="${@{archive}.version}"/>
<remoteRepository url="@{repository}" />
<artifact:remoteRepository url="@{repository}" id="central"/>
<artifact:dependencies pathID="@{archive}.path" useScope="runtime">
<dependency groupId="@{project}"
artifactId="@{archive}"
version="${@{archive}.version}">
<!-- exclude dependencies of ant-antunit (they should be in optional scope) -->
<exclusion groupId="org.apache.ant" artifactId="ant"/>
<exclusion groupId="org.apache.ant" artifactId="ant-launcher"/>
</dependency>
</artifact:dependencies>
</artifact:dependencies>
<!-- now we are left with the problem of getting the files
into our directory -->
<!-- now we are left with the problem of getting the files into our directory -->
<copy todir="${dest.dir}">
<copy todir="${dest.dir}">
<path refid="@{archive}.path" />
<path refid="@{archive}.path"/>
<flattenmapper/>
<flattenmapper/>
</copy>
</copy>
</sequential>
</sequential>
@@ -131,43 +139,41 @@ Set -Ddest=LOCATION on the command line
<target name="nonm2-macros" depends="pick-dest">
<target name="nonm2-macros" depends="pick-dest">
<macrodef name="get-ftp-file">
<macrodef name="get-ftp-file">
<attribute name="host" />
<attribute name="host"/>
<attribute name="port" default="21"/>
<attribute name="port" default="21"/>
<attribute name="remotedir" />
<attribute name="filename" />
<attribute name="localdir" default="${dest.dir}" />
<attribute name="remotedir"/>
<attribute name="filename"/>
<attribute name="localdir" default="${dest.dir}"/>
<attribute name="user" default="anonymous"/>
<attribute name="user" default="anonymous"/>
<attribute name="pw" default="anonymous"/>
<attribute name="pw" default="anonymous"/>
<sequential>
<sequential>
<ftp server="@{host}" port="@{port}" userid="@{user}" password="@{pw}" passive="true"
<ftp server="@{host}" port="@{port}" userid="@{user}" password="@{pw}" passive="true"
remotedir="@{remotedir}" action="get" depends="true" preserveLastModified="true"
skipFailedTransfers="true">
remotedir="@{remotedir}" action="get" depends="true" preserveLastModified="true"
skipFailedTransfers="true">
<fileset dir="@{localdir}">
<fileset dir="@{localdir}">
<include name="@{filename}" />
<include name="@{filename}"/>
</fileset>
</fileset>
</ftp>
</ftp>
</sequential>
</sequential>
</macrodef>
</macrodef>
</target>
</target>
<!-- any init stuff -->
<!-- any init stuff -->
<target name="init" depends="macros" />
<target name="init" depends="macros"/>
<target name="init-no-m2" depends="nonm2-macros" />
<target name="init-no-m2" depends="nonm2-macros"/>
<target name="init-cache">
<target name="init-cache">
<available property="temp.cache.already.exists" file="${temp.dir}" type="dir" />
<available property="temp.cache.already.exists" file="${temp.dir}" type="dir"/>
<condition property="user.wants.temp.cache">
<condition property="user.wants.temp.cache">
<and>
<and>
<isset property="keep.temp.dir" />
<isset property="keep.temp.dir"/>
<not>
<not>
<or>
<or>
<equals arg1="${keep.temp.dir}" arg2="false" casesensitive="false" />
<equals arg1="${keep.temp.dir}" arg2="no" casesensitive="false" />
<equals arg1="${keep.temp.dir}" arg2="off" casesensitive="false" />
<equals arg1="${keep.temp.dir}" arg2="false" casesensitive="false"/>
<equals arg1="${keep.temp.dir}" arg2="no" casesensitive="false"/>
<equals arg1="${keep.temp.dir}" arg2="off" casesensitive="false"/>
</or>
</or>
</not>
</not>
</and>
</and>
@@ -175,174 +181,190 @@ Set -Ddest=LOCATION on the command line
<condition property="delete.temp.cache">
<condition property="delete.temp.cache">
<and>
<and>
<not>
<not>
<isset property="temp.cache.already.exists" />
<isset property="temp.cache.already.exists"/>
</not>
</not>
<not>
<not>
<isset property="user.wants.temp.cache" />
<isset property="user.wants.temp.cache"/>
</not>
</not>
</and>
</and>
</condition>
</condition>
</target>
</target>
<target name="-setup-temp-cache" depends="init-cache" unless="temp.cache.already.exists"
<target name="-setup-temp-cache" depends="init-cache" unless="temp.cache.already.exists"
description="Setup temporary cache for downloaded files">
<mkdir dir="${temp.dir}" />
description="Set up temporary cache for downloaded files">
<mkdir dir="${temp.dir}"/>
</target>
</target>
<target name="-cleanup-temp-cache" depends="init-cache" if="delete.temp.cache"
<target name="-cleanup-temp-cache" depends="init-cache" if="delete.temp.cache"
description="Gets rid of the temporary cache directory">
<delete dir="${temp.dir}" />
description="Get rid of the temporary cache directory">
<delete dir="${temp.dir}"/>
</target>
</target>
<target name="diag" depends="init">
<target name="diag" depends="init">
<echoproperties />
<echoproperties/>
</target>
<target name="antunit"
description="load AntUnit library"
depends="init">
<f2 project="org.apache.ant" archive="ant-antunit"/>
</target>
</target>
<target name="ivy"
<target name="ivy"
description="load Ivy dependency manager"
depends="init">
<f2 project="org.apache.ivy" archive="ivy" />
description="load Ivy dependency manager"
depends="init">
<f2 project="org.apache.ivy" archive="ivy"/>
</target>
</target>
<target name="logging"
<target name="logging"
description="load logging libraries"
depends="init">
<f2 project="log4j" />
<f2 project="commons-logging" archive="commons-logging-api" />
description="load logging libraries (Commons and Log4j) "
depends="init">
<f2 project="log4j"/>
<f2 project="commons-logging" archive="commons-logging-api"/>
</target>
</target>
<target name="junit"
<target name="junit"
description="load junit libraries"
depends="init">
<f2 project="junit" />
description="load JUnit libraries"
depends="init">
<f2 project="junit"/>
<f2 project="org.hamcrest" archive="hamcrest-library"/>
</target>
</target>
<target name="xml"
<target name="xml"
description="load full XML libraries (xalan, resolver)"
depends="init">
<f2 project="xalan" />
<f2 project="xml-resolver" />
description="load full XML libraries (Xalan and xml- resolver)"
depends="init">
<f2 project="xalan"/>
<f2 project="xml-resolver"/>
</target>
</target>
<target name="networking"
<target name="networking"
description="load networking libraries (commons-net; js ch)"
depends="init">
<f2 project="commons-net" />
description="load networking libraries (commons-net and JS ch)"
depends="init">
<f2 project="commons-net"/>
<f2 project="com.jcraft" archive="jsch"/>
<f2 project="com.jcraft" archive="jsch"/>
</target>
</target>
<target name="regexp"
<target name="regexp"
description="load regexp libraries"
depends="init">
<f2 project="regexp" />
<f2 project="oro" />
description="load regexp libraries"
depends="init">
<f2 project="jakarta- regexp"/>
<f2 project="oro"/>
</target>
</target>
<target name="antlr"
<target name="antlr"
description="load antlr libraries "
depends="init">
<f2 project="antlr" />
description="load ANother Tool for Language Recognition (ANTLR) "
depends="init">
<f2 project="antlr"/>
</target>
</target>
<target name="bcel"
<target name="bcel"
description="load bcel libraries"
depends="init">
<copy todir="${dest.dir}">
<url url="${m2.url}/org/apache/bcel/bcel/${bcel.version}/bcel-${bcel.version}.jar"/>
<flattenmapper/>
</copy>
description="load Byte Code Engineering Library (BCEL)"
depends="init">
<f2 project="org.apache.bcel" archive="bcel"/>
</target>
</target>
<target name="jdepend"
<target name="jdepend"
description="load jd epend libraries"
depends="init">
<f2 project="jdepend" />
description="load JD epend libraries"
depends="init">
<f2 project="jdepend"/>
</target>
</target>
<target name="bsf"
<target name="bsf"
description="load bsf libraries "
depends="init">
<f2 project="bsf" />
description="load Bean Scripting Framework "
depends="init">
<f2 project="bsf"/>
</target>
</target>
<target name="jruby"
<target name="jruby"
description="load jr uby"
description="load JR uby"
depends="bsf">
depends="bsf">
<f2 project="org.jruby" archive="jruby"/>
<f2 project="org.jruby" archive="jruby"/>
</target>
</target>
<target name="beanshell"
<target name="beanshell"
description="load beans hell support"
description="load BeanS hell support"
depends="bsf">
depends="bsf">
<f2 project="org.beanshell" archive="bsh"/>
<f2 project="org.beanshell" archive="bsh"/>
<f2 project="org.beanshell" archive="bsh-core"/>
<f2 project="org.beanshell" archive="bsh-core"/>
</target>
</target>
<target name="jython"
<target name="jython"
description="load j ython"
description="load J ython"
depends="bsf">
depends="bsf">
<f2 project="j ython" archive="jython"/>
<f2 project="org.p ython" archive="jython"/>
</target>
</target>
<target name="rhino"
<target name="rhino"
description="load r hino"
description="load R hino"
depends="bsf">
depends="bsf">
<f2 project="rhino" archive="js "/>
<f2 project="org.mozilla" archive="rhino "/>
</target>
</target>
<target name="script"
<target name="script"
description="load script languages (except j ython)"
description="load script languages (except J ython)"
depends="bsf,jruby,beanshell,rhino"/>
depends="bsf,jruby,beanshell,rhino"/>
<target name="debugging"
<target name="debugging"
description="internal a nt debugging"
description="internal A nt debugging"
depends="init">
depends="init">
<f2 project="which" />
<f2 project="which"/>
</target>
</target>
<target name="javamail" depends="init"
description="load javamail">
<f2 project="javax.mail" archive="mail"/>
<target name="javamail"
description="load Java Mail"
depends="init">
<f2 project="javax.mail" archive="javax.mail-api"/>
</target>
</target>
<target name="jspc" depends="init" description="loads Jasper">
<target name="jspc"
description="load Jasper"
depends="init">
<f2 project="tomcat" archive="jasper-compiler"/>
<f2 project="tomcat" archive="jasper-compiler"/>
<f2 project="tomcat" archive="jasper-runtime"/>
<f2 project="tomcat" archive="jasper-runtime"/>
<f2 project="javax.servlet" archive="servlet-api"/>
<f2 project="javax.servlet" archive="servlet-api"/>
</target>
</target>
<target name="jai" depends="init"
description="load java advanced imaging">
<f2 project="javax.media" archive="jai-core" repository="https://repository.jboss.org/nexus/content/groups/public/"/>
<f2 project="com.sun.media" archive="jai-codec" repository="https://repository.jboss.org/nexus/content/groups/public/"/>
<target name="jai"
description="load Java Advanced Imaging"
depends="init">
<f2 project="javax.media" archive="jai-core"
repository="https://repository.jboss.org/nexus/content/groups/public/"/>
<f2 project="com.sun.media" archive="jai-codec"
repository="https://repository.jboss.org/nexus/content/groups/public/"/>
</target>
</target>
<target name="netrexx" depends="init-no-m2,-setup-temp-cache,-fetch-netrexx,-fetch-netrexx-no-commons-net"
description="load NetRexx compiler">
<target name="netrexx"
description="load NetRexx compiler"
depends="init-no-m2,-setup-temp-cache,-fetch-netrexx,-fetch-netrexx-no-commons-net">
<copy todir="${dest.dir}" flatten="true">
<copy todir="${dest.dir}" flatten="true">
<zipfileset src="${temp.dir}/NetRexx.zip">
<zipfileset src="${temp.dir}/NetRexx.zip">
<include name="NetRexx\lib\NetRexxC.jar" />
<include name="NetRexx\browse\license.txt" />
<include name="NetRexx\lib\NetRexxC.jar"/>
<include name="NetRexx\browse\license.txt"/>
</zipfileset>
</zipfileset>
</copy>
</copy>
<antcall target="-cleanup-temp-cache"/>
<antcall target="-cleanup-temp-cache"/>
</target>
</target>
<available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
<available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
<target name="-fetch-netrexx" if="have.commons.net">
<target name="-fetch-netrexx" if="have.commons.net">
<get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
<get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
filename="NetRexx.zip" localdir="${temp.dir}" />
filename="NetRexx.zip" localdir="${temp.dir}"/>
</target>
</target>
<target name="-fetch-netrexx-no-commons-net" unless="have.commons.net">
<target name="-fetch-netrexx-no-commons-net" unless="have.commons.net">
<get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip" dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
<get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip"
dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
</target>
</target>
<target name="xz" depends="init" description="loads XZ for Java">
<target name="xz"
description="load XZ for Java"
depends="init">
<f2 project="org.tukaani" archive="xz"/>
<f2 project="org.tukaani" archive="xz"/>
</target>
</target>
<target name="all"
<target name="all"
description="load all the libraries (except jython)"
description="load all the libraries (except jython)"
depends="ivy,logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,xz,netrexx" />
depends="antunit,ivy,logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,xz,netrexx"/>
</project>
</project>