ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
Subject Re: how to convert linefeeds using fixcrlf.
Date Thu, 18 Sep 2008 20:42:42 GMT
Have you looked at the Ant documentation?

It's pretty simple:

<fixcrlf
   srcdir="${source.dir}"
   eol="${eol.type}"/>

${eol.type} can be "asis", "cr", "lf", and "crlf" or you can (and
probably prefer) the OS names as values "mac", "unix", "dos".

According to the documentation, if you don't specify "eol", it will
default to the eol-type of the machine that this is running on. Very
bad for releases, but great for fixing source code before you use it.

You can also specify <fileset> and in <fileset>, use <include> and
<exclude> too.  You can also use the "includes" and "excludes"
parameters inside the prime <fixcrlf> task itself.


A patternset is a way of specifying the <include> and <exclude> of
filesets for later reference. Think of it as a means of substitution.

Here's the reference to the <fixcrlf> task:
<http://ant.apache.org/manual/CoreTasks/fixcrlf.html>

Here's the reference to patternsets:
<http://ant.apache.org/manual/CoreTypes/patternset.html>


--
David Weintraub
qazwart@gmail.com



On Thu, Sep 18, 2008 at 12:56 PM, Lucas Albers <smurfbait@hotmail.com> wrote:
> How do I convert line feeds to from unix to windows or windows to unix?
>
>
> <target name="convert_linefeeds">
> <fixcrlf srcdir="${logdir}" includes="**/*.log"/>
> </target>
>
> 1.)
>
>
> This shows some example crlf
> http://jira.codehaus.org/browse/MPDIST-9
>
>
> 2.)
> Are these constants?
> What would they be?
>
> <patternset refid="fixcrlf.unix.patternset"/>
> <patternset refid="fixcrlf.win.patternset"/>
>
>
> 3.)
> The first one converts from linux to windows or converts to linux?
>
>
>
> <!-- fix CR/LF for unix dist -->
> <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}" eol="lf" eof="remove">
> <patternset refid="fixcrlf.patternset"/>
> <patternset refid="fixcrlf.unix.patternset"/>
> </ant:fixcrlf>
> <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}" eol="crlf"
> eof="remove">
> <patternset refid="fixcrlf.win.patternset"/>
> </ant:fixcrlf>
>
> <!-- fix CR/LF for win dist -->
> <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}" eol="lf" eof="remove">
> <patternset refid="fixcrlf.unix.patternset"/>
> </ant:fixcrlf>
> <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}" eol="crlf"
> eof="remove">
> <patternset refid="fixcrlf.patternset"/>
> <patternset refid="fixcrlf.win.patternset"/>
> </ant:fixcrlf>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message