ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Berg (ALLETE)" <>
Subject RE: Multiple
Date Thu, 03 Jul 2008 14:20:54 GMT
I very much appreciate the responses on this. I think this is probably
the best solution for the issue. Somehow I missed the ability to use a
replacefilterfile in the documentation. 

As for the dynamic replace count, that's just my condensed and
confusticated way of saying that there may be any number of replaceable
strings for each project (some have one dependent server, some have
dozens). A filter file appears to hanle this and I think this is going
to be the best solution, although possibly not the cleanest as files
will have to be created for dozens of concurrent deployments and erased
on completion. 

I should like to hope that ANT has/will add a core function or extension
like what Jim Cant wrote in response to this issue (for Perl):

"perl -i.bak -ape "s/pat1/repl1/g;s/pat2/repl2/g;...;s/patN/replN/g"

While Perl is known for its ability to manage file/user input like a
crazy person, I think the ability to use a string for multiple search
and replaces would be desirable. I looked at the equivalent RegEx
parsing in the ANT library and they use the Java approach, which is
logical but not necessarily desirable for build scripts.

Something to think about, but thanks again! I'm off to finish the job!


-----Original Message-----
From: Anderson, Rob (Global Trade) [] 
Sent: Tuesday, July 01, 2008 2:02 PM
To: Ant Users List
Subject: RE: Multiple 

Why not use the existing replace task with the replacefilterfile
attribute? I'm not sure what you mean by 'dynamic replace count'.

-Rob Anderson

-----Original Message-----
From: Raymond Berg (ALLETE) [] 
Sent: Tuesday, July 01, 2008 11:45 AM
To: Ant Users List
Subject: Multiple 

I've got a situation where I need to search deployment files for various
server names of a variable count when moving from staging to production
automatically. However, I can't seem to figure out how to handle a
dynamic replace count. I was looking at the script task but found no
syntax that seemed to help. (Also investigated path tools and the few
string operations available)

I'm debating whether to create a new Ant task, but I'm not comfortable
enough with my skills yet to attempt this.

If it helps, my script is currently passing in a single delimited string
as follows: find1~replace#find2~replace2#...#findn~replacen

Any ideas?


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

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

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

View raw message