Fix checkout line endings in .g.cs files

ClangSharp will always generate files with LF, but the --headerFile is copied as-is.
This resulted in files with CR LF and LF line endings, confusing git which would always
report changes in line endings.

This is fixed by checking out *.g.cs and the license headers fed into ClangSharp with LF.

The files have always beeen normalised to LF endings on commit, so this change is not visible in git.
This commit is contained in:
Susko3 2025-06-23 22:41:40 +02:00
parent dddb17d34d
commit f9345ed38a
3 changed files with 6 additions and 2 deletions

6
.gitattributes vendored
View File

@ -22,4 +22,8 @@ App.config text eol=crlf
.gitignore text eol=lf
.gitattributes text eol=lf
*.md text eol=lf
.travis.yml text eol=lf
.travis.yml text eol=lf
# Use lf for files used by ClangSharpPInvokeGenerator
*-license-header.txt text eol=lf
*.g.cs text eol=lf

View File

@ -255,7 +255,7 @@ def typedef(t):
base_command = [
"dotnet", "tool", "run", "ClangSharpPInvokeGenerator",
"--headerFile", csproj_root / "SDL.licenseheader",
"--headerFile", csproj_root / "SDL-license-header.txt",
"--config",
"latest-codegen",