You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Fullam, Jonathan" <Jo...@RIAG.com> on 2003/12/23 18:20:24 UTC

Extending Token Filtering

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




RE: Extending Token Filtering

Posted by didge <di...@foundrylogic.com>.
Jonathan,

Check out http://vpp.sf.net.  It's easy to install and let's you use
Velocity style templates which can support much more powerful configuration
and conditional expansion than what can be achieved with ant's token filter
functionality.  Many people use it for exactly this purpose.

didge

> -----Original Message-----
> From: Fullam, Jonathan [mailto:Jonathan.Fullam@RIAG.com]
> Sent: Tuesday, December 23, 2003 9:20 AM
> To: 'user@ant.apache.org'
> Subject: Extending Token Filtering
>
>
> 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