ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Champlon <>
Subject Re: Passing command line arguments to the "run" target??
Date Sun, 27 Aug 2006 03:26:38 GMT a écrit :
> So I want to do something like
>  ant run -a -b -c
> which should result in "-a -b -c" to be passed to the <java> task.
> Next time I want to do
>  ant run -x a 12 23
> and now "-a a 12 23" should be used by the java task.
A property can be set from the command line, like this :
ant -Dmy.args="-a -b -c"

Then it can be used in the <java> task :
<java ...>
  <arg line="${my.args}"/>

If the command line format is important to you (because for example it's 
what your users are going to type) the most simple solution that comes 
to mind is to write a small script that formats its command line 
parameters into an call ant with a -D option.

I hope that helps.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message