USE THIS AT YOUR OWN RISK! I AM NOT RESPONSIBLE FOR ANYTHING YOU DO BY USING THIS! IF ANY DAMAGE IS DONE BY FOLLOWING THE INSTRUCTIONS HERE OR BY USING MY CODE, IT IS ENTIRELY YOUR RESPONSIBILITY AND I MAY NOT BE HELD LIABLE FOR IT!
This is a simple gradle task for changing line endings in files.
Copy the source code of this task to your_project_dir/buildSrc/src/main/groovy/ChangeLineEndings.groovy
task fixLineEndings(type: ChangeLineEndings) {
changeTo LF
forFile "$buildDir/artifacts/setup.sh"
forFile "$buildDir/artifacts/run.sh"
}
changeTo
accepts one parameter, which has to be either CRLF
, CR
or LF
.
For now it's not possible to use wildcards in file paths supplied to forFile
.