ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Open file and regex replace
Date Tue, 23 Apr 2002 00:52:34 GMT
--- wrote:
> On 04/22/2002 03:14:27 PM, "comp boy" wrote:
> > there a way in ant to open up this constants file search for a key
> > word ie (public static final boolean IS_APPLET=true;) and then change
> > true to false and vise versa.
> I just went through doing something like this recently.
> What I had ant do was create that constants file from scratch
> by using the <echo> command.  The file is still checked into
> source control w/ a big warning at the top that it gets overridden
> during the build and should not be checked in after it gets
> overridden.

Unless you're using an SCM tool that needs a file to be explicitly opened
for editing in order for it to be writable...

I had a sort of similar situation, except there was just one value that
needed to be either "true" or "false", and I did it as a template file
(that was what was checked in to source control), and used <copy> with
filtering to gen the .java file with the correct value (based on a
property setting, with the value of the property being retained from
[development] build to build, so the .java file would only be re-gen'd
when that value changed [ie., went from "true" to "false" or vice-versa],
in order to allow for incremental builds).



Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message