ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: How to best create environment specific properties in an applications property file using ANT
Date Mon, 26 Feb 2007 15:29:40 GMT
I would split the properties (build.propeties, prod.propeties, test.properties, ...)
and load two of them:

<property name="system" value="prod"/> (prod,test,dev...)
<property file="${system}.properties"/>
<property file="build.properties"/>

build.properties contains all properties and in the other files you could 
overwrite (that's why it's loaded first) specific values.


Jan


>-----Urspr√ľngliche Nachricht-----
>Von: Eric Wood [mailto:EWood@llbean.com] 
>Gesendet: Montag, 26. Februar 2007 16:09
>An: Ant Users List
>Betreff: How to best create environment specific properties in 
>an applications property file using ANT
>
>Folks:
>
>I'm looking at how to best create different copies of an application
>property file using ANT.  I have a property file that contains two
>sections: one section with environment specific settings that will vary
>as it is deployed across test, QA, and production servers and one
>section that is constant.  Currently, it is versioned in our 
>source code
>repository so it works in the development environment; this way
>developers can work with it directly in their environment 
>without having
>to change it. When I build their application using ANT I would like to
>generate different versions of the file for environment that I 
>save save
>for later deployment.  I was looking at using filterreaders 
>but they are
>not really setup to substitute a block of properties located in the
>middle of the file.
>
>Any thoughts on how I can best do this task?
>
>Eric
>

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


Mime
View raw message