ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Recursive Property Expansion
Date Mon, 11 Dec 2006 04:09:38 GMT
At 09:15 PM 12/10/2006, you wrote:
 >You can use <propertycopy> from ant-contrib to accomplish some degree
 >of property expansion

...or use a macrodef or, even simpler, use a property file.  Here's 
an example where a property is defined per-project, but globally so 
that all projects can see the property.  For any given project's 
build file, however, one would want to refer to its own property 
generically instead of having to fully qualify the property with it's 
own project name.  For instance...

Globally defined properties (I actually use an XML property file to 
avoid repeating project names constantly)...
myproject.app.Name=My Project
otherproject.app.Name=Other Project

Referenced inside the "myproject" or "otherproject" build files, 
respectively, as....
${app.Name}

To accomplish this, one simply provides a property file with the 
following entry...
app.Name=$${${ant.project.name}.app.Name}


So, within the current "myproject" build, one can refer to 
${app.Name} and get "My Project" and, at the same time, if 
"otherproject" wants to know the value of app.Name for "myproject", 
they can refer to ${myproject.app.Name} while, again, referring to 
its own property as ${app.Name}, which would be "Other Project".


Jake

 >
 >
 >
 >----- Original Message ----
 >From: Jack J. Woehr <jwoehr@absolute-performance.com>
 >To: Ant Users List <user@ant.apache.org>
 >Sent: Friday, December 8, 2006 6:06:21 PM
 >Subject: Re: Recursive Property Expansion
 >
 >
 >Hmm, it just seems like five years ago. It was actually 2004.
 >It's still there in http://issues.apache.org/bugzilla/show_bug.cgi?
 >id=29347
 >
 >On Dec 8, 2006, at 4:49 PM, Jack J. Woehr wrote:
 >
 >> Sometime in 2001 we were all discussing recursive property expansion:
 >
 >--
 >Jack J. Woehr
 >Director of Development
 >Absolute Performance, Inc.
 >jwoehr@absolute-performance.com
 >303-443-7000 ext. 527
 >
 >
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
 >For additional commands, e-mail: user-help@ant.apache.org
 >
 >
 >
 >______________________________________________________________________
 >______________
 >Do you Yahoo!?
 >Everyone is raving about the all-new Yahoo! Mail beta.
 >http://new.mail.yahoo.com
 >
 >---------------------------------------------------------------------
 >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
 >For additional commands, e-mail: user-help@ant.apache.org


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


Mime
View raw message