Le jeu 02/05/2002 � 11:54, Stefan Bodewig a �crit : > On 02 May 2002, Nicolas Mailhot <[EMAIL PROTECTED]> wrote: > > Le jeu 02/05/2002 � 11:33, Stefan Bodewig a �crit : > >> > >> "Ant's" is not and this is for a reason - JAVA_HOME/lib/ext isn't > >> recursive either. > > > > Ok. If you really think being recursive is bad, that's just a switch > > in find. > > We should do that. We also need to check whether it does what we want > it to do on Cygwin (I cannot test it myself).
Ok, unrecursed classpath builder and jikes osx jikespath > * You need to merge in Diane's Darwin hack (of course I can do that > myself, but as you are volunteering 8-) As I wrote in another thread, that's one line in java-functions list of jvms to test if we agree on java-functions use. > * The default location for java-functions should be in ANT_HOME/bin, > not ANT_HOME/lib Did it > * we need your version of java-functions to commit it at the same time > 8-) Could you check the java-function in the jpackage-utils rpm if its suitable for ant commit ? (of course the list still misses the OSX jvm define and the set_javacmd but I can add them quickly if you agree on the core script) > * putting tools.jar at the front rather then the end of CLASSPATH at > least needs some more discussion. I cannot see any problems with > this approach, but maybe others do. I guess if no one manifests himself we'll just have to commit it as is. Regards, -- Nicolas Mailhot
#! /bin/sh
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
# reserved.
# load system-wide ant configuration
[ -r "/etc/ant.conf" ] && . "/etc/ant.conf"
# load user ant configuration
[ -r "$HOME/.antrc" ] && . "$HOME/.antrc"
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true ;;
esac
if [ "$rpmmode" = "true" ] ; then
[ -z "$ANT_HOME" ] && ANT_HOME="/usr"
[ -z "$JAVA_FUNCTIONS" ] && $JAVA_FUNCTIONS="/usr/bin/java-functions"
fi
if [ -z "$ANT_HOME" ] ; then
# try to find ANT
[ -d "/opt/ant" ] && ANT_HOME="/opt/ant"
[ -d "$HOME/opt/ant" ] && ANT_HOME="$HOME/opt/ant"
## resolve links - $0 may be a link to ant's home
PRG=$0
progname=`basename $0`
saveddir="`pwd`"
# need this for relative symlinks
cd "`dirname $PRG`"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname $PRG`/$link"
fi
done
ANT_HOME="`dirname '$PRG'`/.."
# make it fully qualified
ANT_HOME=`cd "$ANT_HOME" && pwd`
cd "$saveddir"
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if [ "$cygwin" = "true" ] ; then
[ -n "$ANT_HOME" ] && ANT_HOME=`cygpath --unix "$ANT_HOME"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
[ -z "$JAVA_FUNCTIONS" ] && $JAVA_FUNCTIONS="$ANT_HOME/bin/java-functions"
if [ -r "$JAVA_FUNCTIONS" ] ; then
. "$JAVA_FUNCTIONS"
set_jvm
set_javacmd
else
echo "No java functions found in $JAVA_FUNCTIONS, operating in dumb mode"
[ -z "$JAVA_HOME" ] && $JAVA_HOME="/usr/lib/java"
[ -z "$JAVACMD" ] && $JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: we cannot execute $JAVACMD"
echo "Please set the JAVACMD environment variable to a correct value"
exit 1
fi
if [ ! -d "$JAVA_HOME" ] ; then
echo "Warning: $JAVA_HOME is not a directory"
echo "Please set the JAVA_HOME environment variable to a correct value"
fi
unset LOCALCLASSPATH
[ -f "$JAVA_HOME/lib/tools.jar" ] && LOCALCLASSPATH="$JAVA_HOME/lib/tools.jar"
[ -f "$JAVA_HOME/lib/classes.zip" ] && LOCALCLASSPATH="$JAVA_HOME/lib/classes.zip"
if [ "$darwin" = "true" -a "$usejikes" = "true" ] ; then
OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
JIKESJARS=`find "$OSXHACK" -name *.jar -maxdepth 1 -printf %p: 2>/dev/null`
[ -z "$JIKESPATH" ] && JIKESPATH="$JIKESJARS" || JIKESPATH="$JIKESPATH:$JIKESJARS"
fi
if [ "$rpmmode" = "true" ] ; then
JAVALIBDIR="/usr/share/java"
JARS="ant ant-optional jaxp_parser xml_apis"
unset COREJARS
for jar in $JARS ; do COREJARS="$COREJARS$JAVALIBDIR/$jar.jar:" ; done
else
COREJARS=`find "$ANT_HOME/lib" -name *.jar -maxdepth 1 -printf %p: 2>/dev/null`
fi
[ -z "$LOCALCLASSPATH" ] && LOCALCLASSPATH="$COREJARS" ||\
LOCALCLASSPATH="$LOCALCLASSPATH:$COREJARS"
# We just constructed a :-ended LOCALCLASSPATH
if [ -n "$CLASSPATH" ] ; then
LOCALCLASSPATH="$LOCALCLASSPATH$CLASSPATH"
fi
# supply JIKESPATH to Ant as jikes.class.path
if [ -n "$JIKESPATH" ] ; then
[ "$cygwin" = "true" ] && JIKESPATH=`cygpath --path --windows "$JIKESPATH"`
ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
fi
# Allow Jikes support (off by default)
[ "$usejikes" = "true" ] && ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
# For Cygwin, switch paths to Windows format before running java
if [ "$cygwin" = "true" ]; then
ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
fi
"$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="$ANT_HOME" $ANT_OPTS org.apache.tools.ant.Main $ANT_ARGS "$@"
--- ant.3 Tue Apr 30 18:10:56 2002
+++ ant.4 Thu May 2 12:19:53 2002
@@ -58,7 +58,7 @@
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
-[ -z "$JAVA_FUNCTIONS" ] && $JAVA_FUNCTIONS="$ANT_HOME/lib/java-functions"
+[ -z "$JAVA_FUNCTIONS" ] && $JAVA_FUNCTIONS="$ANT_HOME/bin/java-functions"
if [ -r "$JAVA_FUNCTIONS" ] ; then
. "$JAVA_FUNCTIONS"
@@ -88,7 +88,7 @@
if [ "$darwin" = "true" -a "$usejikes" = "true" ] ; then
OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
- JIKESJARS=`find "$OSXHACK" -name *.jar -printf %p: 2>/dev/null`
+ JIKESJARS=`find "$OSXHACK" -name *.jar -maxdepth 1 -printf %p:
2>/dev/null`
[ -z "$JIKESPATH" ] && JIKESPATH="$JIKESJARS" ||
JIKESPATH="$JIKESPATH:$JIKESJARS"
fi
@@ -98,7 +98,7 @@
unset COREJARS
for jar in $JARS ; do COREJARS="$COREJARS$JAVALIBDIR/$jar.jar:" ; done
else
- COREJARS=`find "$ANT_HOME/lib" -name *.jar -printf %p: 2>/dev/null`
+ COREJARS=`find "$ANT_HOME/lib" -name *.jar -maxdepth 1 -printf %p:
2>/dev/null`
fi
[ -z "$LOCALCLASSPATH" ] && LOCALCLASSPATH="$COREJARS" ||\
signature.asc
Description: PGP signature
