ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Retrieve property value dynamically?
Date Fri, 21 Mar 2003 18:29:06 GMT
    Can the following be accomplished using properties? I have tried several ways to do this,
but have been unsuccessful. Maybe there is a good reason this is not allowed? Or maybe someone
can suggest an alternative solution.

    I would like to retrieve the value of a property using a dynamic name rather than hard-coding
the name in my buildfile. I am doing this because I do not know the range of possible property
values until runtime. 

Given a property file named "" with the following data.

allbuilds        0,1,2   20030319   20030320   20030321

I need to extract the date of a particular build once the user picks a build number to install.
The following code is an example of what I need to do: 

   <property file=""/>

   <input validargs="${allbuilds}" addproperty="buildnumber" message="Enter build number
to install."/>
   <property name="builddate" value="${build.${buildnumber}.date}}"/>

The result should be builddate getting the value of "20030320". Any assistance or ideas would
be greatly appreciated.

Marshall Jones

Marshall Jones - Software Engineer
AT&T LABS - Custom and Web Services Development


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