ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Schewe <jpsch...@eggplant.mtu.net>
Subject allow one to pass a classpath to ant
Date Sun, 26 Nov 2000 23:26:35 GMT
The way that the current ant scripts are setup it's pretty hard to pass in a
classpath to ant and I really don't like setting environment variables to
project specific settings, so I modified the ant shell script as follows:

At the end of the file put the following, just above the execute command and
change the execute command to use $args instead of $@.
#allow someone to add to the classpath
args=""
for arg in $@; do
  echo $arg
  if [ $arg = "-classpath" ]; then
    set grabarg=grab
  elif [ -n $grabarg ]; then
    LOCALCLASSPATH="$LOCALCLASSPATH:$arg"
    unset grabarg
  else
    args="$args $arg"
  fi
done

$JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.Main
$args

Thought someone else might find this handy.  I haven't figured out how to do
this to the batch file too though.

-- 
Jon Schewe | http://eggplant.mtu.net/~jpschewe
For I am convinced that neither death nor life, neither angels 
nor demons, neither the present nor the future, nor any 
powers, neither height nor depth, nor anything else in all 
creation, will be able to separate us from the love of God that 
is in Christ Jesus our Lord. - Romans 8:38-39
NOTE: My first name has no 'h' in it!  Please be observant.


Mime
View raw message