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: token filtering
Date Tue, 11 Nov 2008 05:54:36 GMT
>I use couple of property files packaged into my war file 
>destined for different environment such as Development, QA, 
>Staging, Production.  I currently keep different versions of 
>each file for each environment having values specific to each 
>env and the 4 different build targets for each env refer to 
>their own matching property files.  They're kinda getting out 
>of hand, having muliple copies of each file!  I would like to 
>keep one version of the files with the changing environment 
>values replaced with tokens and during the compile based on a 
>flag or value being set, such as if flag equal to QA, 
>@ip.address@ should be replaced with qa.ip=ip.add.re.ss.  How 
>is this possile without resorting to ant.contrib?

<property name="flag" value="qa"/>
<property file="${flag}.properties"/>
<property file="default.properties"/>


default.properties contains ALL values.
qa.properties contains the values which DIFFER from the default one.
stageB.properties similar.
flag would be "qa" or "stageB" and load the specified file.
If flag is something else where you havent any properties file, the
non-existing
file is just ignored.


Jan

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


Mime
View raw message