ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Scope of a property
Date Thu, 29 Nov 2001 19:33:41 GMT
--- Erik Hatcher <jakarta-ant@ehatchersolutions.com> wrote:
> > 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.

Huh?  There's a big difference between the first and the second -- the
first will result in running the "myInit" target and the "showMe" target
within the same execution of 'ant', so the <echo> of the "Me" property
will have a value for the property.  The second will run the "myInit"
target within one execution of 'ant', then the "showMe" target within
another execution of 'ant', so the <echo> of the "Me" property will not
have a value.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message