On 8/27/06, Mathieu Champlon <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] 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