Tim and Conor,
Thanks a lot.
-Tamara
-----Original Message-----
From: Conor MacNeill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 7:13 PM
To: [EMAIL PROTECTED]
Subject: RE: Passing input parameters to build.xml
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:[EMAIL PROTECTED]]
>
>
> > 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.
>
>
