ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Setting properties -- Best Practices question
Date Fri, 09 Apr 2004 21:48:22 GMT
> -----Original Message-----
> From: Dominique Devienne [mailto:DDevienne@lgc.com]
> Sent: Friday, April 09, 2004 2:16 PM
> To: 'Ant Users List'
> Subject: RE: Setting properties -- Best Practices question
> 
> 
> > From: Jack Woehr [mailto:jax@purematrix.com]
> > 
> > Is it "good Ant style" to do the following, i.e., depend on the
> > immutability of a property to do
> > a simple choice point, as in choosing between two files based on the
> > existence-or-nonexistence
> > of the first one tested?
> > 
> >      ...
> >      <available file="somepath" property="file-to-use"/>
> >      <property name="file-to-use" value="some-other-path"/>
> >      ...
> 
> Very much so in my book. --DD

I agree. This is common and makes sense. It is similar to a technique I often use, where I
will load certain properties files in a specific order...project properties, then environment
properties, then build properties...

<properties file="${project.name}.properties"/>
<properties file="${env}.properties"/>
<properties file="build.properties"/>

The defaults are defined in the build.properties and perhaps overridden in ${env}.properties
or ${project.name}.properties based on the order in which they are loaded.

-Rob Anderson


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


Mime
View raw message