y values and command line arguments
>
>
> Target "foo" requires property value "bar".
> Property "bar" is meant to be specified through the command line.
> However, I want to provide a default value in target "init". Is
> this valid?
You don't need to put this in an init target. Just in the project will do
<project>
<property name="bar" value="a"
<target name="foo">
...
>
> Is there precendence of one over the other?
Sort of. First to set the value wins.
> Would the command line value
> overwrite the default as desired?
>
Yes, command line goes first, followed by non-target properties, followed by
properties within targets as the targets are evaluated.
ant -Dbar=b
will result in bar have the value b. This command line precedence is one of
the motivations for immutable properties.
Conor
|