ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: replace task
Date Wed, 01 Nov 2000 17:33:40 GMT
> -----Original Message-----
> From:	Jonathan Carlson [SMTP:jcarlson@is.com]
> Sent:	Wednesday, November 01, 2000 6:08 PM
> To:	'ant-user@jakarta.apache.org'
> Subject:	replace task
> 
> Moving on...  ;-)
>  
> Based on the documentation, it looks like the current replace task takes a
> *single* transformation (i.e. token/value) and applies it to *many* files.
> What I need is a task that will take *many* transformations (like from a
> properties file) and apply them to a *single* file (like a script
> template).
> 
>  
> Is there a task I missed that does this or do we need to write one?  If
> so,
> it seems similar enough to the current replace task that maybe they should
> be incorporated into the same task.
> 
	[Kitching Simon]  
	I'd like to see this feature added too...

	The functionality of doing multiple replaces is sort of what
"filters" do,
	but filters only apply when copying a file around.

	I presume you're trying to do what I want: substitute a batch of
values
	into a tree full of files. In my case, after installing a web-app
into tomcat,
	I need to set JDBC params, and other stuff in web.xml. However,
there
	are also other things I need to tweak, like changing a stylesheet
url
	so testing/production look different.

	I ended up writing a perl script to do this (which you're welcome to
	if you email me). It takes a .properties-format file, like

	database1=jdbc:oracle:thin:fred/password@DB1
	database1.poolsize=7
	stylesheet=/stylesheets/devstyle.css

	and modifies the installed document tree.

	PS: if anyone has a better solution for this problem, please
	let me know!! This works ok, but doesn't feel quite right.

	Simon
>  
> Jonathan
>  
> 
> Jonathan Carlson,  Software Developer 
> jcarlson@is.com 
> 
> Such ever was loves way: to rise, it stoops.   
>      - Robert Browning 
> 
> 
>  

Mime
View raw message