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.
Cheers,
Antoine

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


Hi,

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

I'm woring on Windows2000. I'm trying to locate/replace certain consecutive
lines
in some source files, which has line ending character as 0x0a. It's not
happening.
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?

Thanks,
John




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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to