Hi, Rick Thanks a million !!
you've made my day :-))) Dealing with for + macrodef ain't easy, as i never used that before ... Now i have = for list="[EMAIL PROTECTED] and for list="[EMAIL PROTECTED] in the inner loops 3 and 4 Gilbert -----Original Message----- From: Rick Genter [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 3:33 PM To: Ant Users List Subject: RE: Probs with property expansion in <for> loops Try incorporating the name of the lib into the property. Something like: <loadfile property="[EMAIL PROTECTED]" srcFile="K:\r1p1l01a1/@{Lum}/temp/updated.txt" /> Then use [EMAIL PROTECTED] throughout. -- Rick Genter Principal Engineer Silverlink Communications <mailto:[EMAIL PROTECTED]> (781) 272-3080 x242 -----Original Message----- From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 9:18 AM To: [email protected] Subject: Probs with property expansion in <for> loops Hi, i have a problem with properties in <for> scenario = Three lists : - list with all environments that should be served (loaded outside all loops) - list with all servers of one environment (loaded in loop 2) - list of files to be deleted on those servers - list of files to be copied to those servers (generated in the outer loop 1 by a java class, loaded in loop 3 and loop 4) Buildfile structure : ... <!-- property = list with all environments --> <loadfile property="Lums" srcFile="K:\r1p1l01a1\luminfo.txt" /> <target name="main" depends="doall" /> <target name="doall"> <!-- // start loop 1 // --> <for list="${Lums}" param="Lum"> <sequential> <untar src="K:\r1p1l01a1/@{Lum}/transfer/[EMAIL PROTECTED]" dest="K:\r1p1l01a1/@{Lum}/serverdata" overwrite="true" /> <loadfile property="server" srcFile="K:[EMAIL PROTECTED]" /> <java classname="de. ... .ParseCCLogs" failonerror="true"> <arg value="K:\r1p1l01a1/@{Lum}/transfer" /> <arg value="K:\r1p1l01a1/@{Lum}/temp/updated.txt" /> <arg value="K:\r1p1l01a1/@{Lum}/temp/deleted.txt" /> ... </java> <!-- files to be deleted on all servers--> <loadfile property="updatelist" srcFile="K:\r1p1l01a1/@{Lum}/temp/updated.txt" /> <!-- files to be copied to all servers--> <loadfile property="deletelist" srcFile="K:\r1p1l01a1/@{Lum}/temp/deleted.txt" /> <!-- // start loop 2 // --> <for list="${server}" param="server"> <sequential> <!-- // start loop 3 // --> <for list="${deletelist}" param="delfile"> <sequential> <echo message="Delete file -> @{delfile}" /> </sequential> </for> <!-- // end loop 3 // --> <!-- // start loop 4 // --> <for list="${updatelist}" param="copyfile"> <sequential> <echo message="Copy file -> @{copyfile}" /> </sequential> </for> <!-- // end loop 4 // --> </sequential> </for> <!-- // end Loop 2 // --> </sequential> </for><!-- // end Loop 1 // --> Problem = Once the first time the updatelist and deletelist are loaded for the first environment = @{Lum} it cannot be overwrited for the next environment in the list ${Lums}. debugmode says : Override ignored for property updatelist Override ignored for property deletelist when getting into the loop for the second @{Lum} Question = How to make that loops work with a list of input properties, properties expanded correct ? If for loops are the wrong way, what should i do instead ? I wanted to avoid several foreach loops. Any hints ? Regards, Gilbert --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
