ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hayes, Peter" <Peter.Ha...@fmr.com>
Subject RE: Obtaining properties
Date Tue, 03 Apr 2001 17:46:52 GMT
Yes, 

Since tempMain is set to 'proj1.run.main' dereferencing ${tempMain} again
returns 'proj1.run.main' .  I have tried doing multiple dereference <<
${${tempMain}} >> But this does not seem to work.

Pete

-----Original Message-----
From: Anuj Agrawal [mailto:agrawal@lucent.com]
Sent: Tuesday, April 03, 2001 1:21 PM
To: ant-user@jakarta.apache.org
Subject: Re: Obtaining properties


Did you try:

<property name="tempMain" value="${project}.run.main" />
<property name="main" value="${tempMain}" />

??
Anuj.

"Hayes, Peter" wrote:

> I would like to obtain a property by using another property to get it.
>
> I have a prop file like this
> ---------------------
> proj1.run.main = com.xxx.Project1
> proj2.run.main = com.xxx.Project2
> ---------------------
>
> In my build.xml I would like to figure out which project to run based on a
> passed in property.  (-Dproject=proj1)
>
> So in my target would be something like
>
> <property name="main" value="${project}.run.main" />
>
> But instead of main being set to the string "proj1.run.main" I would like
to
> 'dereference' that so it would get the previously set value
> ('com.xxx.Project1')

Mime
View raw message