ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johann.pet...@gmail.com
Subject Re: Passing command line arguments to the "run" target??
Date Sun, 27 Aug 2006 08:06:29 GMT
On 8/27/06, Mathieu Champlon <m.champlon@free.fr> wrote:
>
> johann.petrak@gmail.com 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}"/>
> </java>
>
> 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.


Thank you that cleared up a lot!

Johann

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message