ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Nicholson" <rob...@elastica.com>
Subject RE: How to use hierarchical property files?
Date Wed, 27 Feb 2002 07:56:29 GMT
I've seen something before that went along the lines of this.

Basically any property file named it's parent so when you did a property
lookup it would do a bottom up traversal until it found the entry. 

> -----Original Message-----
> From: Otto Perdeck [mailto:otto.perdeck@xs4all.nl] 
> Sent: Tuesday, February 26, 2002 11:30 AM
> To: Ant Users List
> Subject: Re: How to use hierarchical property files?
> 
> 
> Eric,
> 
> I have no problem with specifying the files in reversed order.
> 
> I posted because I thought I was seeing some very strange 
> behaviour, but I cannot reproduce this; I must have been 
> mistaken. Sorry & thanks.
> 
> -Otto
> 
> ----- Original Message -----
> From: Erik Hatcher <jakarta-ant@ehatchersolutions.com>
> To: Ant Users List <ant-user@jakarta.apache.org>
> Sent: Tuesday, February 26, 2002 2:03 AM
> Subject: Re: How to use hierarchical property files?
> 
> 
> > Reverse the order of your <property file="..."/> statements.  As 
> > strange
> as
> > that sounds, thats how to do it.  Properties are immutable 
> so once set
> they
> > cannot be changed.  Load the highest priority ones first.  
> You seem to 
> > suggest this solution yourself, so I'm not sure what the 
> issue really 
> > is. But this is how its done.
> >
> >     Erik
> >
> > ----- Original Message -----
> > From: "Otto Perdeck" <otto.perdeck@xs4all.nl>
> > To: "Ant Users List" <ant-user@jakarta.apache.org>
> > Sent: Monday, February 25, 2002 5:13 PM
> > Subject: How to use hierarchical property files?
> >
> >
> > Hello,
> >
> > I'd like to be able to use a hierarchical set of optional property 
> > files
> to
> > set up the properties of my project, e.g.:
> >
> > 0. default properties
> > 1. OS family specific properties, if existing, overriding the 
> > previously
> set
> > props
> > 2. OS specfic properties, same
> > 3. host specific properties, same
> > 4. user specific properties, same
> >
> > Simple as this might seem, I could not manage to do this with Ant 
> > alone. Somehow, using
> >
> > <property file=file0/>
> > <property file=file1/>
> > etc.
> >
> > doesn't work, because every new "<property file=...>" seems 
> to reset 
> > ALL properties?! I would *expect* it to just load another set of 
> > properties on top of the existing set. I would *like* it  
> to override 
> > the existing
> values,
> > but I appreciate that Ant props are immutable - but this 
> could easily 
> > be overcome by reversing the order of loading.
> >
> > I now use an external program (in Java, of course) to "cat" all the 
> > given files together, making one large property file.
> >
> > What am I doing wrong? I can't imagine Ant doesn't support 
> something 
> > like this.
> >
> > Thanks,
> >
> > -Otto Perdeck
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   
> <mailto:ant-user-> unsubscribe@jakarta.apache.org>
> > For 
> additional commands, 
> e-mail: 
> > <mailto:ant-user-help@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:ant-user-help@jakarta.apache.org>
> 


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


Mime
View raw message