diff --git a/DotnetCliVersion.txt b/DotnetCliVersion.txt index 4ba19403..bbe838d1 100644 --- a/DotnetCliVersion.txt +++ b/DotnetCliVersion.txt @@ -1 +1 @@ -3.1.300 \ No newline at end of file +3.1.401 \ No newline at end of file diff --git a/build/Build.cs b/build/Build.cs index 42be3f9b..95c88582 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -104,12 +104,19 @@ namespace LibHacBuild } catch (Exception e) { - Logger.Error(e); + if (!e.Message.Contains("not a git repository", StringComparison.OrdinalIgnoreCase)) + { + Logger.Error(e); + } } if (gitRepository == null || gitVersion == null) { Logger.Normal("Unable to read Git version."); + + VersionString = GetCsprojVersion(); + Logger.Normal($"Using version from .csproj: {VersionString}"); + return; } @@ -656,5 +663,10 @@ namespace LibHacBuild return pwd.ToString(); } + + public string GetCsprojVersion() + { + return XmlTasks.XmlPeekSingle(LibHacProject.Path, "/Project/PropertyGroup/VersionPrefix", null); + } } } diff --git a/build/CodeGen/ResultCodegen.cs b/build/CodeGen/ResultCodegen.cs index 565d533d..184ad316 100644 --- a/build/CodeGen/ResultCodegen.cs +++ b/build/CodeGen/ResultCodegen.cs @@ -321,6 +321,12 @@ namespace LibHacBuild.CodeGen hasBom = oldFile.AsSpan(0, 3).SequenceEqual(bom); } + // Make line endings the same on Windows and Unix + if (Environment.NewLine == "\n") + { + text = text.Replace("\n", "\r\n"); + } + byte[] newFile = (hasBom ? bom : new byte[0]).Concat(Encoding.UTF8.GetBytes(text)).ToArray(); if (oldFile?.SequenceEqual(newFile) == true) diff --git a/build/_build.csproj b/build/_build.csproj index e852b673..8e372242 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/src/LibHac/LibHac.csproj b/src/LibHac/LibHac.csproj index a4920296..e9e23fad 100644 --- a/src/LibHac/LibHac.csproj +++ b/src/LibHac/LibHac.csproj @@ -44,7 +44,7 @@ - + diff --git a/tests/LibHac.Tests/LibHac.Tests.csproj b/tests/LibHac.Tests/LibHac.Tests.csproj index 7a208ee4..b298de9c 100644 --- a/tests/LibHac.Tests/LibHac.Tests.csproj +++ b/tests/LibHac.Tests/LibHac.Tests.csproj @@ -7,11 +7,11 @@ - + - +