Browse Source

Add mac, unix and dos as alternatives for <fixcrlf>'s eol option.

Submitted by:	Martin van den Bemt <mllist at mvdb dot net>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273663 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
fb4cd3ac37
4 changed files with 13 additions and 7 deletions
  1. +2
    -0
      WHATSNEW
  2. +4
    -4
      build.xml
  3. +3
    -0
      docs/manual/CoreTasks/fixcrlf.html
  4. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

+ 2
- 0
WHATSNEW View File

@@ -141,6 +141,8 @@ Other changes:
* <zip> can now store Unix permissions in a way that can be
reconstructed by Info-Zip's unzip command.

* <fixcrlf>'s eol attribute now also understand "mac", "unix" and "dos".

Changes from Ant 1.5.1Beta1 to 1.5.1
====================================



+ 4
- 4
build.xml View File

@@ -970,8 +970,8 @@
<fileset dir="${script.dir}/"/>
</copy>

<fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat"/>
<fixcrlf srcdir="${dist.bin}" eol="lf">
<fixcrlf srcdir="${dist.bin}" eol="dos" includes="*.bat"/>
<fixcrlf srcdir="${dist.bin}" eol="unix">
<include name="ant"/>
<include name="antRun"/>
<include name="*.pl"/>
@@ -1142,8 +1142,8 @@
</fileset>
</copy>

<fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat"/>
<fixcrlf srcdir="${src.dist.dir}" eol="lf">
<fixcrlf srcdir="${src.dist.dir}" eol="dos" includes="*.bat"/>
<fixcrlf srcdir="${src.dist.dir}" eol="unix">
<include name="**/*.sh"/>
<include name="**/*.pl"/>
<include name="**/ant"/>


+ 3
- 0
docs/manual/CoreTasks/fixcrlf.html View File

@@ -100,6 +100,9 @@ supports all attributes of <code>&lt;fileset&gt;</code>
<li>cr: convert all EOLs to a single CR</li>
<li>lf: convert all EOLs to a single LF</li>
<li>crlf: convert all EOLs to the pair CRLF</li>
<li>mac: convert all EOLs to a single CR</li>
<li>unix: convert all EOLs to a single LF</li>
<li>dos: convert all EOLs to the pair CRLF</li>
</ul>
Default is based on the platform on which you are running
this task. For Unix platforms, the default is &quot;lf&quot;.


+ 4
- 3
src/main/org/apache/tools/ant/taskdefs/FixCRLF.java View File

@@ -226,10 +226,10 @@ public class FixCRLF extends MatchingTask {
String option = attr.getValue();
if (option.equals("asis")) {
eol = ASIS;
} else if (option.equals("cr")) {
} else if (option.equals("cr") || option.equals("mac")) {
eol = CR;
eolstr = "\r";
} else if (option.equals("lf")) {
} else if (option.equals("lf") || option.equals("unix")) {
eol = LF;
eolstr = "\n";
} else {
@@ -1045,7 +1045,8 @@ public class FixCRLF extends MatchingTask {
* @see EnumeratedAttribute#getValues
*/
public String[] getValues() {
return new String[] {"asis", "cr", "lf", "crlf"};
return new String[] {"asis", "cr", "lf", "crlf",
"mac", "unix", "dos"};
}
}



Loading…
Cancel
Save