ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reeves, Paul C" <pcre...@sandia.gov>
Subject RE: Problems with foreach, target calls, missing properties
Date Fri, 18 Jun 2004 21:42:19 GMT
Thanks for the heads up.  You are correct, a new ant project is being
launched every time the foreach iterates.  That explains the loss of the
properties.  That is certainly behavior that should be documented.

Paul

-----Original Message-----
From: Wascally Wabbit [mailto:wascallywabbit@earthling.net]
Sent: Friday, June 18, 2004 3:08 PM
To: Ant Users List
Subject: Re: Problems with foreach, target calls, missing properties


At 04:21 PM 6/18/2004, you wrote:
>Folks,
>
>I have a build file in which I iterate over a list and call another target
>in the same build file for each element in the list.  In the called-target
I
>then set three properties.  However, when I return to the calling-target
the
>properties are missing.

That's because the called target is being executed in an independent
child project. Calls to set properties affect the child project not
the parent calling project. Either use the dev version of ant-contrib
or use antxtra's callforeach with the 'mode="local"' setting like
   <callforeach mode="local".../>
See the Ant external tasks page for more information.




>Thanks a bunch,
>Paul
>
>Paul C. Reeves, PhD
>
>Sandia National Laboratories
>Department 5533:
>   Next Generation Monitoring Systems
>
>Mailing Address:
>Paul C. Reeves
>Sandia National Laboratories
>P.O. Box 5800
>Albuquerque, NM 87185-0451
>
>pcreeve@sandia.gov
>(505) 844-4918
>(505) 844-9641 FAX

The Wabbit 



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



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


Mime
View raw message