ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tamara Mishiyeva <tmishiy...@giantbear.com>
Subject RE: Passing input parameters to build.xml
Date Wed, 14 Feb 2001 14:50:38 GMT
Tim and Conor,
Thanks a lot.
-Tamara

-----Original Message-----
From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
Sent: Tuesday, February 13, 2001 7:13 PM
To: ant-user@jakarta.apache.org
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: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.
>
>

Mime
View raw message