ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angeshwar Deepak <angesh...@yahoo.com>
Subject How to set global properties thro for-each loop?
Date Tue, 03 Aug 2004 11:03:49 GMT


Hi,

I have modified my build file as

<target name="init-props">
<foreach list="logging,appintegration"
target="test.loop" param="loop.var" inheritall="true"
inheritrefs="true"/>
</target>

  <target name="test.loop">
   <echo message="TEST1: loop.var=${loop.var}" />
   <property name="loops.var" value="${loop.var}" />
   <antcall target="init-props1" />
</target>


    <target name="init-props1" >
	<echo>
	********* Project home: ${loops.var}
	</echo>
.....
</target>

This works perfectly fine.
But I dont want to specify the
   <antcall target="init-props1" />
statement but instead let ant directly come 
to the next target i.e. init-props1 and 
still hold the value of property loop.var

So I want something like this

<target name="init-props">
<foreach list="logging,appintegration"
target="test.loop" param="loop.var" inheritall="true"
inheritrefs="true"/>
</target>

  <target name="test.loop">
   <echo message="TEST1: loop.var=${loop.var}" />
   <property name="loops.var" value="${loop.var}" />

</target>

    <target name="init-props1" >
	<echo>
	********* Project home: ${loops.var}
	</echo>
.....
</target>

This does'nt work. i.e. I cannot see any
data for ${loops.var}. How to set the property in
such a case and continue to execute all the
tasks for each param in the for-each loop.

bye,
with regards,
Deepak.

=====
-----------------------------------------------
 
Deepak Angeswar, 

Home: 
Pfaffenwaldring 48 C / 202, 
70569 Stuttgart, Germany. 
Ph: 
Home: 049-0711-1225292 
Mobile: 049-0176-24039227 

Office: 
Work Student- 
DaimlerChrysler AG 
ITI/TP, 
Building R+V Gebäude, 
Eichwiesenring 14, 
70567 Stuttgart, Germany. 
Email Id: deepak.angeswar@daimlerchrysler.com



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message