ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: How to get the value of a property using another property?
Date Thu, 19 Aug 2004 10:54:58 GMT
see FAQ
http://ant.apache.org/faq.html#propertyvalue-as-name-for-property


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Sharad [mailto:sharad@persistent.co.in]
> Gesendet am: Donnerstag, 19. August 2004 12:52
> An: user@ant.apache.org
> Betreff: How to get the value of a property using another property?
> 
> Hi,
> 
> I want to get the value of a property using another property.
> 
> for eg In the following ant script :
> 
> <project name="test" default="all">
> 	<property name="sharad" value="valueofpropertysharad"/>
> 	<target name="test2">
> 		<echo message="Value of property ${propname} = 
> ${${propname}}"/>
> 	</target>
> 
> 	<target name="all">
> 		<antcall target="test2">
> 			<param name="propname" value="sharad"/>
> 		</antcall>
> 	</target>
> </project>
> 
> i am passing the parameter "propname" to the target test2. I 
> want the target
> test2 to print the value of the property whose name is supplied to the
> target using param tag. If i use ${${propname}} as shown in 
> 4th line above,
> its not working.
> 
> Can anyone please help me to achieve this?
> 
> Thanks and Regards,
> Sharad.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message