You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rez <po...@hotmail.com> on 2008/11/11 05:57:12 UTC
token filtering
Hi
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?
_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008
RE: AW: AW: token filtering
Posted by Ben Tu <bt...@adobe.com>.
I will have it ready for you today.
Testing it....
-----Original Message-----
From: Mark Salter [mailto:marksalter@talktalk.net]
Sent: Sunday, November 16, 2008 2:47 AM
To: Ant Users List
Subject: Re: AW: AW: token filtering
Rez wrote:
> That's what we really need, more examples. Some
> of the current examples are too vague or for very advanced users.
Welcome to the open source world.
If you want to contribute more examples (that would have helped you),
you should take that opportunity. I'm sure people will be grateful for
your efforts.
8)
--
Mark
---------------------------------------------------------------------
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
AW: AW: AW: token filtering
Posted by Ja...@rzf.fin-nrw.de.
>> That's what we really need, more examples. Some
>> of the current examples are too vague or for very advanced users.
>
>Welcome to the open source world.
>
>If you want to contribute more examples (that would have helped you),
>you should take that opportunity. I'm sure people will be grateful for
>your efforts.
Yes, the easiest way is posting to this list and asking for adding the
example.
The more "professional" way is opening a Bugzilla request.
But for "just" manual entries the mailinglist is enough, I thing. But
add why you think that should be added.
Examples are in the form
CODE
EXPLANATION OF THE CODE
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: AW: token filtering
Posted by Mark Salter <ma...@talktalk.net>.
Rez wrote:
> That's what we really need, more examples. Some
> of the current examples are too vague or for very advanced users.
Welcome to the open source world.
If you want to contribute more examples (that would have helped you),
you should take that opportunity. I'm sure people will be grateful for
your efforts.
8)
--
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: AW: AW: token filtering
Posted by Rez <po...@hotmail.com>.
That's great, thanks. That's what we really need, more examples. Some of the current examples are too vague or for very advanced users.> Subject: AW: AW: token filtering> Date: Wed, 12 Nov 2008 06:44:53 +0100> From: Jan.Materne@rzf.fin-nrw.de> To: user@ant.apache.org> > I added a new example in the manual> http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/property.html?revision=712948> > ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----> <property environment="env"/>> <property file="${user.name}.properties"/>> <property file="${env.STAGE}.properties"/>> <property file="build.properties"/>> > This buildfile uses the properties defined in build.properties. Regarding to the environment variable STAGE some or all values could be overwritten, e.g. having STAGE=test and a test.properties you have special values for that (like another name for the test server). Finally all these values could be overwritten by personal settings with a file per user. > ---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----> > Do you think that clarifies that?> > > Jan> > > > >-----Ursprüngliche Nachricht-----> >Von: Rez [mailto:pons32@hotmail.com] > >Gesendet: Dienstag, 11. November 2008 21:57> >An: Ant> >Betreff: RE: AW: token filtering> >> >> >Great, thanks for your help> Subject: AW: token filtering> > >Date: Tue, 11 Nov 2008 06:54:36 +0100> From: > >Jan.Materne@rzf.fin-nrw.de> To: user@ant.apache.org> > >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> > >_________________________________________________________________> >See how Windows® connects the people, information, and fun > >that are part of your life> >http://clk.atdmt.com/MRT/go/119463819/direct/01/> >> > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org> For additional commands, e-mail: user-help@ant.apache.org>
_________________________________________________________________
Color coding for safety: Windows Live Hotmail alerts you to suspicious email.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_safety_112008
AW: AW: token filtering
Posted by Ja...@rzf.fin-nrw.de.
I added a new example in the manual
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/property.html?revision=712948
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
<property environment="env"/>
<property file="${user.name}.properties"/>
<property file="${env.STAGE}.properties"/>
<property file="build.properties"/>
This buildfile uses the properties defined in build.properties. Regarding to the environment variable STAGE some or all values could be overwritten, e.g. having STAGE=test and a test.properties you have special values for that (like another name for the test server). Finally all these values could be overwritten by personal settings with a file per user.
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
Do you think that clarifies that?
Jan
>-----Ursprüngliche Nachricht-----
>Von: Rez [mailto:pons32@hotmail.com]
>Gesendet: Dienstag, 11. November 2008 21:57
>An: Ant
>Betreff: RE: AW: token filtering
>
>
>Great, thanks for your help> Subject: AW: token filtering>
>Date: Tue, 11 Nov 2008 06:54:36 +0100> From:
>Jan.Materne@rzf.fin-nrw.de> To: user@ant.apache.org> > >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>
>_________________________________________________________________
>See how Windows® connects the people, information, and fun
>that are part of your life
>http://clk.atdmt.com/MRT/go/119463819/direct/01/
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: AW: token filtering
Posted by Rez <po...@hotmail.com>.
Great, thanks for your help> Subject: AW: token filtering> Date: Tue, 11 Nov 2008 06:54:36 +0100> From: Jan.Materne@rzf.fin-nrw.de> To: user@ant.apache.org> > >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>
_________________________________________________________________
See how Windows® connects the people, information, and fun that are part of your life
http://clk.atdmt.com/MRT/go/119463819/direct/01/
AW: token filtering
Posted by Ja...@rzf.fin-nrw.de.
>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