ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <>
Subject AW: Use Replace task for multiple line not working with line ending character 0x0a
Date Wed, 15 Oct 2003 17:29:41 GMT
I am not satisfied with the way the replace task is manipulating line
endings either.
The code is doing some arbitrary replacements of line endings in tokens and
values, assuming that the user always want the line ending inside the tokens
and values to be the platform default. My understanding is that the XML
parser is always returning lines separated with \n, and that is not OK for
users working under Windows and wanting to do replacements inside files
having the normal Windows line endings of \r\n.
The solution will be to add some new attributes to the replace task, to
specify how to handle the tokens and values.
My suggestion would be to create 2 new multivalued (EnumeratedAttribute
class) attributes called lineendingtoken and lineendingvalue, with a similar
choice of values as in the fixcrlf task, so that users doing some
cross-platform work can achieve what they want.
I saw this problem because I am using cygwin and particularly cygwin cvs to
download the files of ant, including the testcases and their data.
So I have had to fixcrlf a bunch of files in the ReplaceTest testcase to
make it pass for me.

-----Urspr√ľngliche Nachricht-----
Von: Yu, John []
Gesendet: Mittwoch, 15. Oktober 2003 19:08
An: ''
Betreff: Use Replace task for multiple line not working with line ending
character 0x0a


I posted this question in the user list, but thought it probably should come

I'm woring on Windows2000. I'm trying to locate/replace certain consecutive
in some source files, which has line ending character as 0x0a. It's not
After checking the source code, I can see that Ant is expecting line ending
character to be the same as the one got from system property.

My questions are:
1. Is there any way to get around this?
2. Any plan to support different line ending character in the future?


The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

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

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

View raw message