Always use LF line endings in generated stdlib code

The code generation uses a mixture of literal `\n` characters and `appendln`. The latter insert `\r\n` on Windows by default, causing generated files to contain a mixture of line endings.

This commit sets the `line.separator` system property for the generator to `\n` so that `appendln` will never insert `\r` characters. As an additional measure, `.gitattributes` files were added to checkout generated stdlib files always with LF line endings.
This commit is contained in:
AJ Alt
2019-06-26 17:02:10 -07:00
committed by ilya-g
parent 7a096b305f
commit ed96197d6b
5 changed files with 5 additions and 0 deletions
@@ -0,0 +1 @@
*.kt eol=lf
@@ -0,0 +1 @@
*.kt eol=lf
@@ -0,0 +1 @@
*.kt eol=lf
@@ -0,0 +1 @@
*.kt eol=lf
@@ -33,4 +33,5 @@ task run(type: JavaExec) {
main 'generators.GenerateStandardLibKt'
classpath sourceSets.main.runtimeClasspath
args = ["${rootDir}"]
systemProperty 'line.separator', '\n'
}