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 73711 invoked from network); 14 Feb 2001 00:11:40 -0000 Received: from cortex-gw.magna.com.au (HELO smtp.cortexebusiness.com.au) (203.174.140.214) by h31.sny.collab.net with SMTP; 14 Feb 2001 00:11:40 -0000 Received: (from daemon@localhost) by smtp.cortexebusiness.com.au (8.10.0/8.10.0) id f1E0BiI06346 for ; Wed, 14 Feb 2001 11:11:44 +1100 (EST) Received: from UNKNOWN(192.168.1.32), claiming to be "snotty" via SMTP by ripley, id smtpdAAA2Way9l; Wed Feb 14 11:11:42 2001 From: "Conor MacNeill" To: Subject: RE: Passing input parameters to build.xml Date: Wed, 14 Feb 2001 11:12:35 +1100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <67FE02381F67D3119F960008C7845A2C0201CFD7@nt_syd_ex09.macbank> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I just thought that I would add that you should only be using build.sh if you are building ant itself. If you just want to use ant, you should be using the ant script or running the ant Java class directly. Conor > From: Tim Vernum [mailto:Tim.Vernum@macquarie.com.au] > > > > Is there any way to pass parameters from build.sh to build.xml script? > > (for example, build.sh accepts some parameters from the command > line and has to pass them to build.xml) > > Yes. > You need to use the "-D" syntax, eg > ant -D"some.property=$1" target > > Then you could refer to it int the ant build.xml as > ${some.property} > > If you don't know how many args you need you could do something > like (untested) > > ANT_DEFINES="" > ARG_NUM=1 > while [ $# -ge 1 ] > do > ANT_DEFINES="${ANT_DEFINES} -Darg${ARG_NUM}=$1" > shift > let ARG_NUM=$ARGNUM+1 > done > > ant ${ANT_DEFINES} > > But then you have the problem of working out how to deal with them in ant. > >