> I want to discuss a little bit more on this.

A topic dear to my heart....

> >From what I understand, a property within a target will not be available
to
> another target unless there is a dependence.

Well, sort of.  For the same execution thread (terminology is a bit off
here) properties are available any time after being defined.

> For example,
>
> <target name="myInit">
> <property name="Me" value="IsMe"/>
> </target>
>
> <target name="showMe">
> <echo message="${Me}"/>
> </target>
>
> the above echo will not display any.
>

These two targets are never executed at the same time.  You'd run these by
doing one of:

    ant myInit showMe

-or-

    ant myInit
    ant showMe

Both are essentially equivalent and each invocation starts fresh with
properties.

> However, the following will work
> <target name="showMe" depends="myInit">
> <echo message="${Me}"/>
> </target>
>
>
> But anyway, in order to make a property global, you have to put it outside
> targets.
> Am I right?

Again, you're right in that this is typically how it would work, but other
scenarios exist using <ant>/<antcall> so that a property defined can be
overridden or set for the invocation.

Clear as mud?!  :)

    Erik



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

Reply via email to