ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Thoughts about properties
Date Thu, 31 Jan 2002 21:38:35 GMT

I would like to suggest two extensions to ant's use of .properties files
(maybe ant can already do these things, but between reading the doc
and experimenting I didn't see how):

     1) Add a '-properties <filename>' to specify a properties file
          which in effect "globally" for a single ant run.  Obviously
          it's possible to obtain something close to this functionality
          by inserting the <properties file=.../> tag at the top of my
          build file, but if I have my build.xml files set up in a
          cascading manner (as I do) and want the flexibility to build
          against any build file in any directory, I have to include the
          <properties> tag in every single build file.  And I believe that
          ant will reload that same properties file with each build.xml
          it parses, which seems like kind of a waste.

     2) Support cascading .properties files.  That is, define some
          distinguished string (like 'INCLUDE_PROPERTIES=<filename>'
          or something) to indicate that once you're done loading the
          current properties file, then go out and load the specified one

I think my reasons for requesting (1) are pretty clear.  My reason for
requesting (2)
is simply that my project has some properties which need to be constant
a given development environment (so all builds would reference a single,
environment-specific .properties file), and other properties which may
change from
one build to the next, and need to be configurable by the end user (and
driven off a file in ${user.home}).  If suggestions (1) and (2) are both
then it would be quite easy to slurp up both sets of propeties exactly once
for a
single build, no matter where in my source tree I'm building.  All it would
(once the .properties files are defined) is a slight modification to the
ant wrapper.

Furthermore, the properties defined in the "parent" .properties file could
act as
defaults for properties defined in the "child" .properties file, in case a
certain user
doesn't want to/doesn't know about the user-specific .properties file in
their home

Just a suggestion.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message