ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <ddevie...@gmail.com>
Subject Re: Search for properties file in parent directories
Date Thu, 11 Nov 2010 17:07:07 GMT
On Thu, Nov 11, 2010 at 4:33 AM, Ludwig, Michael
<Michael.Ludwig@delphi-mb.de> wrote:
> On the command line, I can instruct ant to go searching for a build
> file by climbing up the directory tree: [...]
> From within a script, I can instruct ant to load properties from a
> file using <property file="rz.properties"/>.
>
> Is there a way to instruct Ant to go searching for the properties
> file by climbing up the directory tree, just like "ant -s" does for build files?

As Antoine already mentioned, not for an arbitrarily-deep hierarchy,
and not without contorsions.

But may I inquire why you need that? In my experience, properties
files are in known locations, either absolute, or more likely relative
to the "basedir", or some file.

For example, If in your case the .properties is in config/ relative to
the build.xml that would found via the -s CLI switch, you can load the
properties file using <property file="${basedir}/config/rz.properties"
/>, whereas <property file="rz.properties" /> uses either ${basedir}
or the current directory (I don't remember which).

Just a guess as to the motivation behind your question ;) --DD

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


Mime
View raw message