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:
@@ -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'
|
||||
}
|
||||
Reference in New Issue
Block a user