You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Scotte Zinn <sz...@patronix.com> on 2000/09/11 12:22:27 UTC

[PATCH] Replace task only touches file if there is a change to be made

I currently have two projects, one stable (but uses the replace task to
alter the source code in one of the files) and the second is work in
progress and depends on the stable library.

Whenever I build the second project, the first one always gets built too
since the replace task touches one of the source files, even though there
were no actual changes to be made to the source file for the replace task.

Here is a patch to the replace task.  It only replaces the source file with
the new file if the token was actually found in the source file.  That is,
if it can't find the file, it doesn't alter the file, and therefore, doesn't
touch the timestamp and force a needless re-compile of the stable library.

-- Scotte