ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Mitchell <>
Subject Re: *****spam***** RE: properties handling problem
Date Mon, 31 Jul 2006 18:22:41 GMT
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 ${@{hostname}_@{num}} (assuming args named same as 
original properties) within your macro.

This works in ant 1.6.2 anyway.


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.
 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: [] 
>Sent: maandag 31 juli 2006 11:06
>Subject: properties handling problem
>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.
>I think like this: server="${$hostname}_${num}}"
>but it didn't work..
>Could somebody help me..
>best regards..
><!-- =================================
>                      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
>                 ================================= -->
>        <target name="availability" description="Checking the systems for
>                <echo message="Verfügbarkeitscheck Nr  ${num}"/>
>                <delete file="${available}/*.available"/>
>                <ftp action="get" password="${password}"
>userid="${username}" remotedir="${availabledir}">
>                        <fileset dir="${available}">
>                                <include name="*.available" />
>                        </fileset>
>                </ftp>
>                <available file="${available}/"${$hostname}_${num}}".available"
>                <antcall target="upload"></antcall>
>        </target>
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message