Hello Michael,
I do not know of any way of doing this in a generic fashion.
If you have few levels of directories and the number of directories is
known, you can write this :
<property file="abc.properties"/>
<property file="../abc.properties"/>
<property file="../../abc.properties/>
<property file="../../../abc.properties"/>
this will not bail out if one of the property files does not exists and
it will read the files in the order of the ant xml.
As usual with properties, when a key/value pair is found it is not
modifiable afterwards.
You may want to create a custom task which does what you need,
especially if you have use cases with different numbers of directories
to look in ... You can pretty well write a custom task which eithers
extends the property task of ant or delegates to it.
Regards,
Antoine
On 11/11/2010 5:33 AM, Ludwig, Michael wrote:
On the command line, I can instruct ant to go searching for a build
file by climbing up the directory tree:
ant -h
...
-find<file> (s)earch for buildfile towards the root of
-s<file> the filesystem and use it
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?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org