You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sharad <sh...@persistent.co.in> on 2004/08/19 12:52:28 UTC

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


Re: How to get the value of a property using another property?

Posted by Angeshwar Deepak <an...@yahoo.com>.
Hi,

Set the inheritall="true" property.

with regards,
Deepak.

--- Sharad <sh...@persistent.co.in> wrote:

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



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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