ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Wood" <EW...@llbean.com>
Subject RE: How to best create environment specific properties in an applications property file using ANT
Date Mon, 26 Feb 2007 15:37:33 GMT
This is for a utility/tool called hibernate that we are incorporating into our application
and it uses a configuration file called hibernate.cfg.xml that I do not think that I can split.

I'm currently using the expandproperties filterread along with loadfile to load the environment
specific settings. I can't version the development copy because I haven't found an ANT way
to clip the section of the original file that contains the development environment setting
out before I load the other environment settings in.

Eric

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
Sent: Monday, February 26, 2007 10:30 AM
To: user@ant.apache.org
Subject: AW: How to best create environment specific properties in an applications property
file using ANT

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


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


Mime
View raw message