Hello,

you can have several options.
1) Provide the options as the value of one property
like this:
ant -Dmy.java.program.opts="-opt1 value1 -opt2 value2
-opt3 value3 ..."
Then in your build script grab them like this:
<java classname="...">
    <arg line="${my.java.program.opts}"/>
</java>

2) you can provide the value of each options as a
property:
ant -Dopt1=value1 -Dopt2=value2 -Dopt3=value3 ...
<java classname="...">
    <arg value="-opt1"/>
    <arg value="${opt1}"/>
    <arg value="-opt2"/>
    <arg value="${opt1}"/>
    <arg value="-opt3"/>
    <arg value="${opt1}"/>
...
</java>

Note that in both cases you can provide in your build
script default values for those properties and specify
them on the command line only if you need them
different from the defaults.

1) is more flexible, since you can provide a random
number of agruments. But it is also inconvenient if
you want to change only one option to be different
from the default ones.

Regards
Ivan

P.S. Also regardless of the way I pass options to my
Java programs I found that Jakarta CLI is a quite
usefull command line parser, that extracts easily the
options.

--- Ray Tayek <[EMAIL PROTECTED]> wrote:

> hi, i would like to say: ant run arg1 arg2 ... and
> have the run task 
> grab the args and pass them to  the <java> task as 
> <arg value="?"/>
> 
> does anyone have an idiom for doing this? or must i
> use environment 
> variables or something else?
> 
> thanks 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



                
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to