Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 69b19da

Browse files
authored
Codegen line endings (#1189)
* Have the code generator fix up the line endings after generations * Internal changelog
1 parent c55e363 commit 69b19da

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
### Internal
2323

2424
- Added the `IComponentMetaclass` and `ICommandMetaclass` interfaces. Where we previously would use reflection to find instances of various component/command related types, we now lookup through generated metaclasses. [#1173](https://github.com/spatialos/gdk-for-unity/pull/1173)
25+
- Code Generator now enforces platform line endings. [#1189](https://github.com/spatialos/gdk-for-unity/pull/1189)
2526

2627
## `0.2.9` - 2019-09-16
2728

workers/unity/Packages/io.improbable.gdk.tools/.CodeGenTemplate/CodeGenerationLib/Jobs/CodegenJob.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ public void Run()
6262
fileSystem.CreateDirectory(fileInfo.DirectoryPath);
6363
}
6464

65-
fileSystem.WriteToFile(fileInfo.CompletePath, entry.Value);
65+
// Fix up line endings
66+
var contents = entry.Value
67+
.Replace("\r\n", "\n")
68+
.Replace("\n", Environment.NewLine);
69+
70+
fileSystem.WriteToFile(fileInfo.CompletePath, contents);
6671
}
6772
}
6873

0 commit comments

Comments
 (0)