ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Wood" <ew...@llbean.com>
Subject Re: Extending Token Filtering
Date Tue, 23 Dec 2003 17:33:08 GMT
Here is an example on how I used it to replace tokens in a property file that were deployment
environment specific.

<copy tofile="tmpConfigFileDontTouchy.properties" file="config_files.properties" >
            <filterchain>
                <linecontains>
                    <contains value="@${current.env}@"/>
                </linecontains>
                <replacetokens>
                    <token key="${current.env}" value=" "/>
                </replacetokens>
            </filterchain>
        </copy>


Eric Wood
ewood@llbean.com
207.552.2306

>>> Jonathan.Fullam@RIAG.com 12/23/03 12:20PM >>>
Hello,

I need to be able to do token replacement upon doing a move or copy task but
I need more specific functionality than is provided with ANT.

For instance:

If the filters file contains the following:

	key=value1

And the file to be filtered contains:

	someProperty=@key-defaultValueHere@

Then the resultant file should contain the following:

	someProperty=value1


Now if the filters file doesn't contain

	key=value1 (or any other value for key)

Then the resultant file will contain
	
	someProperty=defaultValueHere


Does anybody have any suggestions on how I might accomplish this in ANT.
Any help is greatly appreciated.

Thanks,
Jonathan





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


Mime
View raw message