ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Replacing tokens without token delimiters
Date Thu, 10 Feb 2005 13:21:59 GMT
<replaceregexp>?

Jan

> -----Urspr√ľngliche Nachricht-----
> Von: LECONTE LaurentROSI/SICOR
> [mailto:laurent.leconte@francetelecom.com]
> Gesendet am: Donnerstag, 10. Februar 2005 14:16
> An: user@ant.apache.org
> Betreff: Replacing tokens without token delimiters
> 
> Hello all,
> 
> we've recently decided to replace all our shell scripts with 
> ant tasks, and I'm currently faced with the following 
> problem: I need to replace arbitrary strings in a number of 
> source files with different values, e.g. "http://www.foo.com" 
> would be replaced by "http://test.bar.net", "prod.value=5" by 
> "test.value=10", etc. 
> The problem is that the strings to be changed aren't clearly 
> (i.e. with a distinctive begin/end character) delimited in 
> the source files.
> 
> I have a property file where all the strings to be replaced, 
> as well as their new values, are defined. I've tried to do this :
> 
> <copy todir="${new.dir}">
> 	<fileset refid="filesToBeChanged"/>
> 	<filterset begintoken="" endtoken="">
> 		<filtersfile file="${my.property.file}"/>
> 	</filterset>
> </copy>
> 
> However, this fails because filterset won't accept empty 
> delimiters. I've thought of using the replace task instead, 
> but I can't define the tokens to be replaced using a property 
> file: I have to list them all by hand in the build.xml file. 
> Is there any way to avoid listing all the replacement strings 
> in the build.xml file and still use the replace task?
> 
> Thanks in advance.
> 
> Laurent Leconte
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message