From b002eddf94ec3b320791999adbd905f99afc2884 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 17 Jan 2012 10:15:55 +0000
Subject: [PATCH] Fix OPENDJ-407: Upgrade version of Ant included in OpenDJ server sources
---
opends/ext/ant/fetch.xml | 157 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 132 insertions(+), 25 deletions(-)
diff --git a/opends/ext/ant/fetch.xml b/opends/ext/ant/fetch.xml
index a0cc2a9..d0628d2 100644
--- a/opends/ext/ant/fetch.xml
+++ b/opends/ext/ant/fetch.xml
@@ -29,8 +29,8 @@
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 --Default--
- -Ddest=optional optional dir ${ant.home}/lib/optional (for Ant developers)
+ -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.
@@ -60,10 +60,25 @@
<!-- load in our properties table -->
<property file="${lib.dir}/libraries.properties"/>
+ <!-- Temporary cache for working files -->
+ <property name="temp.dir" location="${user.home}/.ant/tempcache" />
+ <property name="keep.temp.dir" value="true" />
+
<import file="get-m2.xml" />
<target name="pick-dest">
- <property name="dest" value="system" />
+ <fail>
+ <condition>
+ <not>
+ <isset property="dest"/>
+ </not>
+ </condition>ERROR
+Set -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)
+ </fail>
+
<condition property="dest.dir"
value="${lib.dir}">
<equals arg1="${dest}" arg2="system" />
@@ -88,9 +103,10 @@
<macrodef name="f2">
<attribute name="project" />
<attribute name="archive" default="@{project}"/>
+ <attribute name="repository" default="${m2.repo}"/>
<sequential>
<fail>
- Unknown archive @{archive} -no property @{archive}.version defined.
+ Unknown archive @{archive} -no property @{archive}.version defined in ${lib.dir}/libraries.properties.
<condition>
<not>
<isset property="@{archive}.version"/>
@@ -101,21 +117,83 @@
<dependency groupID="@{project}"
artifactID="@{archive}"
version="${@{archive}.version}"/>
+ <remoteRepository url="@{repository}" />
</artifact:dependencies>
<!-- now we are left with the problem of getting the files
into our directory -->
- <copypath destdir="${dest.dir}" pathref="@{archive}.path">
+ <copy todir="${dest.dir}">
+ <path refid="@{archive}.path" />
<flattenmapper/>
- </copypath>
+ </copy>
</sequential>
</macrodef>
</target>
+ <target name="nonm2-macros" depends="pick-dest">
+ <macrodef name="get-ftp-file">
+ <attribute name="host" />
+ <attribute name="port" default="21"/>
+ <attribute name="remotedir" />
+ <attribute name="filename" />
+ <attribute name="localdir" default="${dest.dir}" />
+ <attribute name="user" default="anonymous"/>
+ <attribute name="pw" default="anonymous"/>
+ <sequential>
+ <ftp server="@{host}" port="@{port}" userid="@{user}" password="@{pw}" passive="true"
+ remotedir="@{remotedir}" action="get" depends="true" preserveLastModified="true"
+ skipFailedTransfers="true">
+ <fileset dir="@{localdir}">
+ <include name="@{filename}" />
+ </fileset>
+ </ftp>
+ </sequential>
+ </macrodef>
+
+ </target>
+
<!-- any init stuff -->
<target name="init" depends="macros" />
+ <target name="init-no-m2" depends="nonm2-macros" />
+
+ <target name="init-cache">
+ <available property="temp.cache.already.exists" file="${temp.dir}" type="dir" />
+ <condition property="user.wants.temp.cache">
+ <and>
+ <isset property="keep.temp.dir" />
+ <not>
+ <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" />
+ </or>
+ </not>
+ </and>
+ </condition>
+ <condition property="delete.temp.cache">
+ <and>
+ <not>
+ <isset property="temp.cache.already.exists" />
+ </not>
+ <not>
+ <isset property="user.wants.temp.cache" />
+ </not>
+ </and>
+ </condition>
+ </target>
+
+ <target name="-setup-temp-cache" depends="init-cache" unless="temp.cache.already.exists"
+ description="Setup temporary cache for downloaded files">
+ <mkdir dir="${temp.dir}" />
+ </target>
+
+ <target name="-cleanup-temp-cache" depends="init-cache" if="delete.temp.cache"
+ description="Gets rid of the temporary cache directory">
+ <delete dir="${temp.dir}" />
+ </target>
+
<target name="diag" depends="init">
<echoproperties />
@@ -141,26 +219,12 @@
<f2 project="xml-resolver" />
</target>
- <!--
- This is not used as
- 1. we want the names of the libraries to be fixed, or it will break Ant's manifest.
- 2. We like to get the more recent artifacts than are in the repo at the time of writing (2006-10-16)
- 3. Xerces has a dependency on v 1.3.03 of Xml-apis, which is wrong.
- If/when the artifacts stabilize, we could switch to it.
- -->
-
- <target name="xerces"
- description="load an updated version of Xerces"
- depends="init">
- <f2 project="xerces" archive="xercesImpl"/>
- <f2 project="xerces" archive="xmlParserAPIs" />
- </target>
-
<target name="networking"
description="load networking libraries (commons-net; jsch)"
depends="init">
<f2 project="commons-net" />
<f2 project="com.jcraft" archive="jsch"/>
+ <available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
</target>
<target name="regexp"
@@ -220,8 +284,8 @@
</target>
<target name="script"
- description="load script languages"
- depends="bsf,jruby,jython,beanshell,rhino"/>
+ description="load script languages (except jython)"
+ depends="bsf,jruby,beanshell,rhino"/>
<target name="debugging"
description="internal ant debugging"
@@ -229,8 +293,51 @@
<f2 project="which" />
</target>
+ <target name="javamail" depends="init"
+ description="load javamail">
+ <f2 project="javax.mail" archive="mail"/>
+ </target>
+
+ <target name="jspc" depends="init" description="loads Jasper">
+ <f2 project="tomcat" archive="jasper-compiler"/>
+ <f2 project="tomcat" archive="jasper-runtime"/>
+ <f2 project="javax.servlet" archive="servlet-api"/>
+ </target>
+
+ <target name="jai" depends="init"
+ description="load java advanced imaging">
+ <f2 project="javax.media" archive="jai-core" repository="http://repository.jboss.org/maven2"/>
+ <f2 project="com.sun.media" archive="jai-codec" repository="http://repository.jboss.org/maven2"/>
+ </target>
+
+ <target name="netrexx" depends="init-no-m2,-setup-temp-cache,networking,-fetch-netrexx,-fetch-netrexx-no-commons-net,-cleanup-temp-cache"
+ description="load NetRexx compiler" />
+
+ <target name="-fetch-netrexx" depends="-setup-temp-cache"
+ description="FTPs NetRexx compiler from IBM site" if="have.commons.net">
+ <get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
+ filename="NetRexx.zip" localdir="${temp.dir}" />
+ <copy todir="${dest.dir}" flatten="true">
+ <zipfileset src="${temp.dir}/NetRexx.zip">
+ <include name="NetRexx\lib\NetRexxC.jar" />
+ <include name="NetRexx\browse\license.txt" />
+ </zipfileset>
+ </copy>
+ </target>
+
+ <target name="-fetch-netrexx-no-commons-net" depends="-setup-temp-cache"
+ description="FTPs NetRexx compiler from IBM site" unless="have.commons.net">
+ <get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip" dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
+ <copy todir="${dest.dir}" flatten="true">
+ <zipfileset src="${temp.dir}/NetRexx.zip">
+ <include name="NetRexx\lib\NetRexxC.jar" />
+ <include name="NetRexx\browse\license.txt" />
+ </zipfileset>
+ </copy>
+ </target>
+
<target name="all"
- description="load all the libraries"
- depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script" />
+ description="load all the libraries (except jython)"
+ depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx" />
</project>
--
Gitblit v1.10.0