Ant _does_ expand macro parameters the way you want, however (this discrepancy is unintuitive and baffling to me, but that's another story). So, you could make the part that checks availability a macrodef, passing in ${hostname} and ${num} as arguments. You will then be able to reference [EMAIL PROTECTED]@{num}} (assuming args named same as original properties) within your macro.

This works in ant 1.6.2 anyway.

Geoff

Rémon van Gijn wrote:

I believe ant dies not support the parsing of inner variables (property expansion), 
so you will have to make a combination with a <expandproperties> task and 
loading the resulting property file after that.

There are some ant extensions that make it possible, but they are in 
development. http://www.efanomars.net/pf/index.html  PFunctions is one I found 
last time, it does that what you want, but it's alpha.

Met vriendelijke groet,
Rémon van Gijn


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: maandag 31 juli 2006 11:06
To: [email protected]
Subject: properties handling problem

Hi,
this is Code for deliver files to different systems with a pre-check...

I'll iterate with der foreach-Task.

The Problem is, I don't now how to set the properties.

Properties
available=availability
availabledir=/export/home/heisc01/anttest/
output=output
hostlist=host_1,host_2,host_3
hostname=host

I think like this: server="${$hostname}_${num}}"
but it didn't work..

Could somebody help me..

best regards..
Beni


<!-- =================================
                     target: Schleife für Verfügbarkeitstest
                    ================================= -->
       <target name="availableloop">
                               <foreach list="1,2,3,4" target="availability"
param="num" />
               </target>

       <!-- =================================
                 target: Verfügbarkeitstest der Systeme als Voraussetzung für
upload
                ================================= -->
       <target name="availability" description="Checking the systems for
availability">
               <echo message="Verfügbarkeitscheck Nr  ${num}"/>
               <delete file="${available}/*.available"/>
               <ftp action="get" password="${password}"
server="${$hostname}_${num}}"
userid="${username}" remotedir="${availabledir}">
                       <fileset dir="${available}">
                               <include name="*.available" />
                       </fileset>
               </ftp>
               <available file="${available}/"${$hostname}_${num}}".available"
property=""${$hostname}_${num}}".ready"/>
               <antcall target="upload"></antcall>
       </target>


---------------------------------------------------------------------
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]

Reply via email to