Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 27722 invoked from network); 26 Nov 2000 23:27:02 -0000 Received: from hl137-192-66-146.hyperlink.onvoy.com (HELO eggplant.mtu.net) (137.192.66.146) by locus.apache.org with SMTP; 26 Nov 2000 23:27:02 -0000 Received: from workstation.mn.mtu.net.mtu.net (jpschewe@workstation.mn.mtu.net [192.168.42.101]) by eggplant.mtu.net (8.10.1/8.10.1) with SMTP id eAQNQZO21458 for ; Sun, 26 Nov 2000 17:26:36 -0600 (CST) Sender: jpschewe@workstation.mn.mtu.net To: ant-user@jakarta.apache.org Subject: allow one to pass a classpath to ant Reply-To: jpschewe@eggplant.mtu.net From: Jon Schewe Date: 26 Nov 2000 17:26:35 -0600 Message-ID: Lines: 33 User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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.