Converts text source files to local OS formatting conventions, as well as repair text files damaged by misconfigured or misguided editors or file transfer programs.
This task can take the following arguments:
- srcdir
- destdir
- include
- exclude
- cr
- eol
- tab
- eof
- encoding
Of these arguments, only
sourcedir is required.
When this task executes, it will scan the srcdir based on the include and exclude properties.
This version generalises the handling of EOL characters, and allows for CR-only line endings (which I suspect is the standard on Macs.) Tab handling has also been generalised to accommodate any tabwidth from 2 to 80, inclusive. Importantly, it will leave untouched any literal TAB characters embedded within string or character constants.
Warning: do not run on binary files. Caution: run with care on carefully formatted files. This may sound obvious, but if you don't specify asis, presume that your files are going to be modified. If "tabs" is "add" or "remove", whitespace characters may be added or removed as necessary. Similarly, for CR's - in fact "eol"="crlf" or cr="add" can result in cr characters being removed in one special case accommodated, i.e., CRCRLF is regarded as a single EOL to handle cases where other programs have converted CRLF into CRCRLF.
@author Sam Ruby rubys@us.ibm.com
@author Peter B. West
@version $Revision: 1.37.2.2 $ $Name: $
@since Ant 1.1
@ant.task category="filesystem"