You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Todd McGrath <to...@yahoo.com> on 2000/06/22 17:31:03 UTC

multiple files with Replace task

Hi everybody-

I need replace multiple strings in *multiple* .java
files, but unable to use the Replace task.  It seems
as if I need to specify each individual file and
cannot work on a directory tree of files?

Has anyone else ran into this?

Any thoughts?

(I don't think KeySubst task will work, because file
name needs ot remain the same)  

I'll be happy to try to write a new task for this type
of functionality, but wanted to check with the list
first.

-Todd

__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/

RE: multiple files with Replace task

Posted by Conor MacNeill <co...@cognet.com.au>.
Todd,

Charles Tewksbury posted a task for this (which I have attached below). I'll
try to have a look at committing it this weekend. Charles' posting is copied
below:

Conor


> -----Original Message-----
> From: Charles Tewksbury [mailto:tewks@adhesive.com]
> Sent: Wednesday, 17 May 2000 2:32
> To: ant-dev@jakarta.apache.org
> Subject: ReplaceMultiple Task
>
>
> Greetings,
>
> I have included a new taskdef for replacing a string in all files in a
> directory and subdirectories.  It is generally based on the Replace task.
>
> Usage:
>     <replacemultiple
> 	basedir="${some.dir}"
> 	token="lookForTerm"
> 	value="replaceWithTerm"
>      />
>
> It actually extends MatchingTask vice Task and the default.properties file
> would be modified by adding:
> 	replacemultiple=org.apache.tools.ant.taskdefs.ReplaceMultiple
>
> Being relatively new to ANT, I'm not sure if this taskdef has already been
> built and is awaiting inclusion but since I can't find one in the
> repository, I am sending this out for review.
>
> - Charles W. Tewksbury
>
>
>




> -----Original Message-----
> From: Todd McGrath [mailto:toddmcgrath@yahoo.com]
> Sent: Friday, 23 June 2000 1:31
> To: ant-dev@jakarta.apache.org
> Subject: multiple files with Replace task
>
>
> Hi everybody-
>
> I need replace multiple strings in *multiple* .java
> files, but unable to use the Replace task.  It seems
> as if I need to specify each individual file and
> cannot work on a directory tree of files?
>
> Has anyone else ran into this?
>
> Any thoughts?
>
> (I don't think KeySubst task will work, because file
> name needs ot remain the same)
>
> I'll be happy to try to write a new task for this type
> of functionality, but wanted to check with the list
> first.
>
> -Todd
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages with Yahoo! Messenger.
> http://im.yahoo.com/
>