Re: Scope of a property

2001-11-29 Thread Diane Holt

--- Erik Hatcher [EMAIL PROTECTED] 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

=
([EMAIL PROTECTED])



__
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:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Scope of a property

2001-11-29 Thread Erik Hatcher

Oops I stand corrected.   Thanks Diane.  Thats what I get for posting
without trying it first.

I never really use the multiple target command-line feature, and spoke out
of line  Sorry for the confusion.

Erik



- Original Message -
From: Diane Holt [EMAIL PROTECTED]
To: Ant Users List [EMAIL PROTECTED]
Sent: Thursday, November 29, 2001 2:33 PM
Subject: Re: Scope of a property


 --- Erik Hatcher [EMAIL PROTECTED] 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

 =
 ([EMAIL PROTECTED])



 __
 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:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]




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




Re: Scope of a property

2001-11-28 Thread Holger Danske

 is this literally taken from your buildfile?  What
 do you expect that
 property task to do without either a value, location
 or ref attribute?


  target name=check unless=is.checked
property name=is.checked/
!-- Applicationtype --
condition
property=check.application_type.setting
  ...
/condition

!-- Deploy --
condition property=check.deploy.setting
value=true
  ...
/condition
  /target


  !-- Redeployen der Anwendung im ausgepackten
Zustand --
  target name=redeploy.expand depends=init,
check
antcall target=clear/
antcall target=deploy.expand/
  /target


  target name=clear depends=init, check
if=check.application_type.setting
...
  /target

  target name=deploy.expand depends=init, check
if=check.deploy.setting
...
  /target


The check target is running thrice.

JD

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Ihre E-Mail noch individueller? - http://domains.yahoo.de

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




Re: Scope of a property

2001-11-28 Thread Stefan Bodewig

On Wed, 28 Nov 2001, Holger Danske [EMAIL PROTECTED] wrote:

   target name=check unless=is.checked
 property name=is.checked/

this is going to result in in BuildException in Ant 1.5 as one of
value,ref or location is required when using the name attribute.  I'm
not sure whether this simply has been a no-op in Ant 1.4, but I think
so.  So you probably don't set the property at all.

   target name=redeploy.expand depends=init,
 check
 antcall target=clear/
 antcall target=deploy.expand/
   /target

Here you are really doing the equivalent of

ant clear
ant deploy.expand

issued on the command line - of course check will be consulted once
for each run (and once as dependency of redeploy.expand).  The target
called in the antcalled execeutions should be skipped if the
property has been set, though.

Why don't you use

target name=redeploy.expand depends=clear,deploy.expand

?

Stefan

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




RE: Scope of a property

2001-11-28 Thread Li, Jerry

I want to discuss a little bit more on this.

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

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.

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?

thanks,

Jerry

-Original Message-
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 4:20 AM
To: [EMAIL PROTECTED]
Subject: Re: Scope of a property


On Wed, 28 Nov 2001, Holger Danske [EMAIL PROTECTED] wrote:

   target name=check unless=is.checked
 property name=is.checked/

this is going to result in in BuildException in Ant 1.5 as one of
value,ref or location is required when using the name attribute.  I'm
not sure whether this simply has been a no-op in Ant 1.4, but I think
so.  So you probably don't set the property at all.

   target name=redeploy.expand depends=init,
 check
 antcall target=clear/
 antcall target=deploy.expand/
   /target

Here you are really doing the equivalent of

ant clear
ant deploy.expand

issued on the command line - of course check will be consulted once
for each run (and once as dependency of redeploy.expand).  The target
called in the antcalled execeutions should be skipped if the
property has been set, though.

Why don't you use

target name=redeploy.expand depends=clear,deploy.expand

?

Stefan

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

-- 
Note:  The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and deleting it from
your computer. Thank you. 
--

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




Re: Scope of a property

2001-11-28 Thread Erik Hatcher

 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]