Browse Source

Help getting the wrapper scripts that ship with Ant's "normal"

distributions and the RPMs closer to each other by (1) allowing a
system wide configuration file in /etc and (2) using some environment
variables to enable RPM specific behavior.

Submitted by:	Henri GOMEZ <hgomez@slib.fr>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272589 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
9517bc1a98
1 changed files with 37 additions and 5 deletions
  1. +37
    -5
      src/script/ant

+ 37
- 5
src/script/ant View File

@@ -3,6 +3,20 @@
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights # Copyright (c) 2001-2002 The Apache Software Foundation. All rights
# reserved. # reserved.


# load system-wide ant configuration
if [ -f "/etc/ant.conf" ] ; then
. /etc/ant.conf
fi

# provide default values for people who don't use RPMs
if [ -z "$rpm_mode" ] ; then
rpm_mode=false;
fi
if [ -z "$usejikes" ] ; then
usejikes=false;
fi

# load user ant configuration
if [ -f "$HOME/.antrc" ] ; then if [ -f "$HOME/.antrc" ] ; then
. $HOME/.antrc . $HOME/.antrc
fi fi
@@ -84,10 +98,22 @@ if [ -n "$CLASSPATH" ] ; then
LOCALCLASSPATH="$CLASSPATH" LOCALCLASSPATH="$CLASSPATH"
fi fi


# add in the dependency .jar files
DIRLIBS="${ANT_HOME}"/lib
for i in "${DIRLIBS}"/*.jar
do
# in rpm_mode get ant/optional/xml parser&api from JAVALIBDIR
if $rpm_mode; then
JAVALIBDIR=/usr/share/java
for i in ant ant-optional jaxp_parser xml_apis
do
if [ -z "$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH=$JAVALIBDIR/$i.jar
else
LOCALCLASSPATH="$i.jar":"$LOCALCLASSPATH"
fi
done
else
# add in the dependency .jar files in non-RPM mode (the default)
DIRLIBS="${ANT_HOME}"/lib
for i in "${DIRLIBS}"/*.jar
do
# if the directory is empty, then it will return the input string # if the directory is empty, then it will return the input string
# this is stupid, so case for it # this is stupid, so case for it
if [ "$i" != "${DIRLIBS}/*.jar" ] ; then if [ "$i" != "${DIRLIBS}/*.jar" ] ; then
@@ -97,7 +123,8 @@ do
LOCALCLASSPATH="$i":"$LOCALCLASSPATH" LOCALCLASSPATH="$i":"$LOCALCLASSPATH"
fi fi
fi fi
done
done
fi


if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
@@ -134,6 +161,11 @@ if [ -n "$JIKESPATH" ] ; then
ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH" ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
fi fi


# Allow Jikes support (off by default)
if $usejikes; then
ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
fi

# For Cygwin, switch paths to Windows format before running java # For Cygwin, switch paths to Windows format before running java
if $cygwin; then if $cygwin; then
ANT_HOME=`cygpath --path --windows "$ANT_HOME"` ANT_HOME=`cygpath --path --windows "$ANT_HOME"`


Loading…
Cancel
Save