ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: command line arguments
Date Fri, 08 Feb 2008 23:35:32 GMT
On Feb 8, 2008 3:53 PM, Mansour <mansour77@yahoo.com> wrote:
> Is there a way to pass command line arguments to ant build file without
> using the jvm paramets (ie. without -Dsome.option=some.value).
>
> I need something like:
> ant target option.
>
> Thank you.

I hacked something like this using the well known Unix pattern of
having anything following -- to be stuffed into Ant properties called
0, 1 2 3 and #, that you access as ${0}, ... Of course ${#} was the
number of arguments, and I also had a ${*} containing all the
arguments except ${0} (to use Ant as a launcher, ${0} being the
program, and ${*} its arguments). I think it's just changes in
Main.java, I could share it, although based on an old Main.java. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message