You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Bemowski, Paul A" <pb...@z-tel.com> on 2000/08/10 23:42:44 UTC

Problem/suggesion with replace

I've got a fairly small problem with the replace task.  

My situation:

I run idl2java and it generates a ton of .java files.  I then run replace to
get rid of some bad 'extends' lines.  This, in effect, is a 'touch' on every
file.  Then the javac task thinks it needs to re-compile everything, even if
I only re-generate 1 idl file.  Very time consuming.

I would be nice if replace would only touch files that it needs to.  I see 2
ways to do this
1) scan the file read only first, and if it contains the token, do the
replace.  This is expensive, so maybe you'd want it to be an option of the
task.
2) grab the timestamp on the file, then do the replace. Count the number of
occurances of the token you hit.  If the number is 0, re-set the timestamp
of the file back to it's original value.

Thoughts??

Paul Bemowski
Z-Tel Communications