Browse Source

1) modify ant script to *NOT* . include /etc/ant.conf

if ANT_HOME variable is set.
2) apply jpackage patch to ant script
3) modify manual to include the change in behaviour to ANT_HOME and jpackage



git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@462590 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
6e6999de17
2 changed files with 31 additions and 39 deletions
  1. +8
    -30
      docs/manual/install.html
  2. +23
    -9
      src/script/ant

+ 8
- 30
docs/manual/install.html View File

@@ -227,33 +227,6 @@ restrictions on the classes which may be loaded by an extension.</p>
</td>
</tr>
</table>
<table width="80%">
<tr>
<td colspan="2">
<b>Linux Note:</b>
</td>
</tr>
<tr>
<td width="5%">&nbsp;</td>
<td>
A jpackage rpm version of ant may be installed on your machine,
say as part of install of Fedora Core 3. If another version
of ant is installed, the rpm version <b><u>will</u></b> take
priority. This is due to the fact that ant bash script file
dot includes the /etc/ant.conf file from the jpackage distribution.
The current version of this file (sept 2006) overwrites the
ANT_HOME environment variable. If this happens, ant will
issue a warning. To fix this, modify the line in /etc/ant.conf
<br/>
<code>ANT_HOME=/usr/share/ant</code>
<br/>
to be
<br/>
<code>ANT_HOME=${ANT_HOME:-/usr/share/ant}</code>.
</td>
</tr>
</table>


<h3><a name="optionalTasks">Optional Tasks</a></h3>
<p>Ant supports a number of optional tasks. An optional task is a task which
@@ -420,9 +393,14 @@ Having a symbolic link set up to point to the JVM/JSK version makes updates more
The <a href="http://www.jpackage.org">JPackage project</a> distributes an RPM version of Ant.
With this version, it is not necessary to set <code> JAVA_HOME </code>or
<code> ANT_HOME </code>environment variables and the RPM installer will correctly
place the Ant executable on your path. The <code> ANT_HOME </code>environment variable will
be ignored, if set, when running the JPackage version of Ant.
</p><p>
place the Ant executable on your path.
</p>
<p>
<b>NOTE:</b> <em>Since Ant 1.7.0</em>, if the <code>ANT_HOME</code>
environment variable is set, the jpackage distribution will be
ignored.
</p>
<p>
Optional jars for the JPackage version are handled in two ways. The easiest, and
best way is to get these external libraries from JPackage if JPackage has them
available. (Note: for each such library, you will have to get both the external


+ 23
- 9
src/script/ant View File

@@ -44,18 +44,11 @@ if $no_config ; then
rpm_mode=false
usejikes=$use_jikes_default
else
orig_ant_home=$ANT_HOME
# load system-wide ant configuration
if [ -f "/etc/ant.conf" ] ; then
# load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
if [ -z "$ANT_HOME" -a -f "/etc/ant.conf" ] ; then
. /etc/ant.conf
fi

# Normally users do not expect that /etc/ant.conf will override ANT_HOME
if [ -n "$orig_ant_home" -a "$orig_ant_home" != "$ANT_HOME" ] ; then
echo "Warning: ANT_HOME has been overridden by /etc/ant.conf from $orig_ant_home to $ANT_HOME"
echo " Use ant -noconfig if this is not desired."
fi

# load user ant configuration
if [ -f "$HOME/.ant/ant.conf" ] ; then
. $HOME/.ant/ant.conf
@@ -168,6 +161,27 @@ if $rpm_mode && [ -f /usr/bin/build-classpath ] ; then
fi
fi

# If no optional jars have been specified then build the default list
if [ -z "$OPT_JAR_LIST" ] ; then
for file in /etc/ant.d/*; do
if [ -f "$file" ]; then
case "$file" in
*~) ;;
*#*) ;;
*.rpmsave) ;;
*.rpmnew) ;;
*)
for dep in `cat "$file"`; do
case "$OPT_JAR_LIST" in
*"$dep"*) ;;
*) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep"
esac
done
esac
fi
done
fi

# Explicitly add javac path to classpath, assume JAVA_HOME set
# properly in rpm mode
if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then


Loading…
Cancel
Save