You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/05/13 09:01:49 UTC
cvs commit: ant/src/testcases/org/apache/tools/ant/filters ConcatFilterTest.java
bodewig 2004/05/13 00:01:49
Modified: src/etc/testcases/filters concat.xml
src/testcases/org/apache/tools/ant/filters
ConcatFilterTest.java
Log:
Make tests pass on MacOS X.
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.5 +2 -0 ant/src/etc/testcases/filters/concat.xml
Index: concat.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/filters/concat.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- concat.xml 25 Sep 2003 06:12:25 -0000 1.4
+++ concat.xml 13 May 2004 07:01:48 -0000 1.5
@@ -7,6 +7,8 @@
<echo file="result/append.txt" message="this-should-be-the-last-line${line.separator}"/>
<copy file="input/head-tail.test" tofile="input/concatfilter.test"/>
<fixcrlf srcDir="input" includes="concatfilter.test"/>
+ <!-- to be consistent on MacOS X. fixcrlf uses CR while line.sep is LF -->
+ <fixcrlf srcDir="result" includes="append.txt,prepend.txt"/>
</target>
<target name="cleanup">
1.11 +3 -1 ant/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java
Index: ConcatFilterTest.java
===================================================================
RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ConcatFilterTest.java 9 Mar 2004 16:48:56 -0000 1.10
+++ ConcatFilterTest.java 13 May 2004 07:01:49 -0000 1.11
@@ -21,6 +21,7 @@
import java.io.IOException;
import org.apache.tools.ant.BuildFileTest;
+import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.util.FileUtils;
/**
@@ -29,7 +30,8 @@
public class ConcatFilterTest extends BuildFileTest {
private static FileUtils fu = FileUtils.newFileUtils();
- private static final String lSep = System.getProperty("line.separator");
+ private static final String lSep =
+ Os.isFamily("mac") ? "\r" : System.getProperty("line.separator");
private static final String FILE_PREPEND_WITH =
"this-should-be-the-first-line" + lSep
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
and MacOS X (was Re: cvs commit:
ant/src/testcases/org/apache/tools/ant/filters ConcatFilterTest.java)
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 14 May 2004, Peter Reilly <pe...@corvil.com> wrote:
> Stefan Bodewig wrote:
>><fixcrlf> will use CR as line separator on any Mac, including on
>>Macs that run MacOS X. OS X obviously deals with all kinds of line
>>separators but its native separator (including Java's line.separator
>>system property) is a LF.
>
> I think that it would be a good idea to use line.separator for the
> default value.
I tend to agree, but there is this BC thing.
> It is less brittle than the current method,
So true.
> and I cannot imagine that many people would have used <fixcrlf> on
> MacOSX without setting the eol attribute.
Poll user@ant?
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/testcases/org/apache/tools/ant/filters ConcatFilterTest.java
Posted by Peter Reilly <pe...@corvil.com>.
Stefan Bodewig wrote:
>On 13 May 2004, <bo...@apache.org> wrote:
>
>
>
>>Make tests pass on MacOS X.
>>
>>
>
>To recap the situation.
>
><fixcrlf> will use CR as line separator on any Mac, including on Macs
>that run MacOS X. OS X obviously deals with all kinds of line
>separators but its native separator (including Java's line.separator
>system property) is a LF.
>
>The real solution probably would be to patch <fixcrlf> to base its
>decision on the line.separator property, but I'm really concerned
>about backwards compatibility since this behavior is part of <fixrclf>
>since Ant 1.1 and has been wrong since then as well - IIRC the first
>(pre-)releases of OS X have already been available in 2000.
>
>
I think that it would be a good idea to use line.separator for the
default value.
It is less brittle than the current method, and I cannot imagine that
many people would have used <fixcrlf> on MacOSX without
setting the eol attribute.
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: cvs commit: ant/src/testcases/org/apache/tools/ant/filters
ConcatFilterTest.java
Posted by Stefan Bodewig <bo...@apache.org>.
On 13 May 2004, <bo...@apache.org> wrote:
> Make tests pass on MacOS X.
To recap the situation.
<fixcrlf> will use CR as line separator on any Mac, including on Macs
that run MacOS X. OS X obviously deals with all kinds of line
separators but its native separator (including Java's line.separator
system property) is a LF.
The real solution probably would be to patch <fixcrlf> to base its
decision on the line.separator property, but I'm really concerned
about backwards compatibility since this behavior is part of <fixrclf>
since Ant 1.1 and has been wrong since then as well - IIRC the first
(pre-)releases of OS X have already been available in 2000.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org