mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
feat: Use new versioning strategy
- Rename BuildHash to SCMVersion - Expose the actual commit hash as a new `commit_hash.txt` - Update GetGitHash() to actually return the git hash
This commit is contained in:
parent
0c1b2a03b2
commit
2b96f2187c
9 changed files with 67 additions and 61 deletions
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
|
|
@ -137,6 +137,7 @@ jobs:
|
||||||
|
|
||||||
$newVersion = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\TEMP_gitver.txt")
|
$newVersion = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\TEMP_gitver.txt")
|
||||||
$revision = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\revision.txt")
|
$revision = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\revision.txt")
|
||||||
|
$commitHash = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\commit_hash.txt")
|
||||||
Remove-Item -Force -Recurse .\scratch
|
Remove-Item -Force -Recurse .\scratch
|
||||||
|
|
||||||
if (Test-Path -Path $branchName) {
|
if (Test-Path -Path $branchName) {
|
||||||
|
|
@ -147,7 +148,7 @@ jobs:
|
||||||
} else {
|
} else {
|
||||||
Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip"
|
Move-Item -Force ".\canary.zip" ".\${branchName}\latest.zip"
|
||||||
$versionData.AssemblyVersion = $newVersion
|
$versionData.AssemblyVersion = $newVersion
|
||||||
$versionData | add-member -Force -Name "GitSha" $newVersion -MemberType NoteProperty
|
$versionData | add-member -Force -Name "GitSha" $commitHash -MemberType NoteProperty
|
||||||
$versionData | add-member -Force -Name "Revision" $revision -MemberType NoteProperty
|
$versionData | add-member -Force -Name "Revision" $revision -MemberType NoteProperty
|
||||||
$versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version"
|
$versionData | ConvertTo-Json -Compress | Out-File ".\${branchName}\version"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,57 +124,45 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Needed temporarily for CI -->
|
<!-- Needed temporarily for CI -->
|
||||||
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>
|
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>
|
||||||
|
<CommitHashFile>$(OutputPath)commit_hash.txt</CommitHashFile>
|
||||||
<DalamudRevisionFile>$(OutputPath)revision.txt</DalamudRevisionFile>
|
<DalamudRevisionFile>$(OutputPath)revision.txt</DalamudRevisionFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Target Name="GetGitCommitCount" BeforeTargets="WriteGitHash" Condition="'$(CommitCount)'==''">
|
<Target Name="GetVersionData" BeforeTargets="WriteVersionData" Condition="'$(SCMVersion)'=='' And '$(Configuration)'=='Release'">
|
||||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" rev-list --count HEAD" ConsoleToMSBuild="true">
|
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" rev-list --count HEAD" ConsoleToMSBuild="true">
|
||||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitCommitCount" />
|
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitCommitCount" />
|
||||||
</Exec>
|
</Exec>
|
||||||
|
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --match=NeVeRmAtCh --always --abbrev=40 --dirty" ConsoleToMSBuild="true">
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitCommitHash" />
|
||||||
<PropertyGroup>
|
|
||||||
<CommitCount>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitCount), @"\t|\n|\r", ""))</CommitCount>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Exec Command="echo|set /P ="$(CommitCount)" > $(DalamudRevisionFile)" IgnoreExitCode="true" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)'=='' And '$(Configuration)'=='Release'">
|
|
||||||
<!-- write the hash to the temp file.-->
|
|
||||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --long --tags --always --dirty" ConsoleToMSBuild="true">
|
|
||||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitDescribeOutput" />
|
|
||||||
</Exec>
|
</Exec>
|
||||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" rev-parse" ConsoleToMSBuild="true">
|
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --tags --always --dirty" ConsoleToMSBuild="true">
|
||||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudFullGitCommitHash" />
|
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitDescribeOutput" />
|
||||||
</Exec>
|
</Exec>
|
||||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))\..\lib\FFXIVClientStructs" describe --long --always --dirty" ConsoleToMSBuild="true">
|
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))\..\lib\FFXIVClientStructs" describe --long --always --dirty" ConsoleToMSBuild="true">
|
||||||
<Output TaskParameter="ConsoleOutput" PropertyName="ClientStructsGitDescribeOutput" />
|
<Output TaskParameter="ConsoleOutput" PropertyName="ClientStructsGitDescribeOutput" />
|
||||||
</Exec>
|
</Exec>
|
||||||
|
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BuildHash>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitDescribeOutput), @"\t|\n|\r", ""))</BuildHash>
|
<CommitCount>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitCount), @"\t|\n|\r", ""))</CommitCount>
|
||||||
<BuildHashClientStructs>$([System.Text.RegularExpressions.Regex]::Replace($(ClientStructsGitDescribeOutput), @"\t|\n|\r", ""))</BuildHashClientStructs>
|
<CommitHash>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitHash), @"\t|\n|\r", ""))</CommitHash>
|
||||||
|
<SCMVersion>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitDescribeOutput), @"\t|\n|\r", ""))</SCMVersion>
|
||||||
|
<CommitHashClientStructs>$([System.Text.RegularExpressions.Regex]::Replace($(ClientStructsGitDescribeOutput), @"\t|\n|\r", ""))</CommitHashClientStructs>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Looks like this is the only way to write a file without a carriage return in msbuild... -->
|
<Exec Command="echo|set /P ="$(CommitCount)" > $(DalamudRevisionFile)" IgnoreExitCode="true" />
|
||||||
<Exec Command="echo|set /P ="$(BuildHash)" > $(TempVerFile)" IgnoreExitCode="true" />
|
<Exec Command="echo|set /P ="$(CommitHash)" > $(CommitHashFile)" IgnoreExitCode="true" />
|
||||||
</Target>
|
<Exec Command="echo|set /P ="$(SCMVersion)" > $(TempVerFile)" IgnoreExitCode="true" />
|
||||||
|
|
||||||
<Target Name="GetGitHashStub" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)'=='' And '$(Configuration)'=='Debug'">
|
|
||||||
<!-- Set the BuildHash property to contain some placeholder, if it wasn't already set.-->
|
|
||||||
<PropertyGroup>
|
|
||||||
<LocalBuildText>Local build at $([System.DateTime]::Now.ToString(yyyy-MM-dd HH:mm:ss))</LocalBuildText>
|
|
||||||
<BuildHash>$(LocalBuildText)</BuildHash>
|
|
||||||
<BuildHashClientStructs>???</BuildHashClientStructs>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<!-- Looks like this is the only way to write a file without a carriage return in msbuild... -->
|
|
||||||
<Exec Command="echo|set /P ="$(BuildHash)" > $(TempVerFile)" IgnoreExitCode="true" />
|
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile">
|
<Target Name="GenerateStubVersionData" BeforeTargets="WriteVersionData" Condition="'$(SCMVersion)'=='' And '$(Configuration)'!='Release'">
|
||||||
|
<!-- stub out version since it takes a while. -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<SCMVersion>Local build at $([System.DateTime]::Now.ToString(yyyy-MM-dd HH:mm:ss))</SCMVersion>
|
||||||
|
<CommitHashClientStructs>???</CommitHashClientStructs>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="WriteVersionData" BeforeTargets="CoreCompile">
|
||||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||||
|
|
@ -185,21 +173,21 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(SCMVersion)' != ''">
|
||||||
<_Parameter1>GitHash</_Parameter1>
|
<_Parameter1>SCMVersion</_Parameter1>
|
||||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
<_Parameter2>$(SCMVersion)</_Parameter2>
|
||||||
</AssemblyAttributes>
|
</AssemblyAttributes>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(CommitCount)' != ''">
|
||||||
<_Parameter1>GitCommitCount</_Parameter1>
|
<_Parameter1>GitCommitCount</_Parameter1>
|
||||||
<_Parameter2>$(CommitCount)</_Parameter2>
|
<_Parameter2>$(CommitCount)</_Parameter2>
|
||||||
</AssemblyAttributes>
|
</AssemblyAttributes>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(CommitHashClientStructs)' != ''">
|
||||||
<_Parameter1>GitHashClientStructs</_Parameter1>
|
<_Parameter1>GitHashClientStructs</_Parameter1>
|
||||||
<_Parameter2>$(BuildHashClientStructs)</_Parameter2>
|
<_Parameter2>$(CommitHashClientStructs)</_Parameter2>
|
||||||
</AssemblyAttributes>
|
</AssemblyAttributes>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(DalamudFullGitCommitHash)' != ''">
|
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(CommitHash)' != ''">
|
||||||
<_Parameter1>FullGitHash</_Parameter1>
|
<_Parameter1>GitHash</_Parameter1>
|
||||||
<_Parameter2>$(DalamudFullGitCommitHash)</_Parameter2>
|
<_Parameter2>$(CommitHash)</_Parameter2>
|
||||||
</AssemblyAttributes>
|
</AssemblyAttributes>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ public sealed class EntryPoint
|
||||||
|
|
||||||
var dalamud = new Dalamud(info, fs, configuration, mainThreadContinueEvent);
|
var dalamud = new Dalamud(info, fs, configuration, mainThreadContinueEvent);
|
||||||
Log.Information("This is Dalamud - Core: {GitHash}, CS: {CsGitHash} [{CsVersion}]",
|
Log.Information("This is Dalamud - Core: {GitHash}, CS: {CsGitHash} [{CsVersion}]",
|
||||||
Util.GetGitHash(),
|
Util.GetScmVersion(),
|
||||||
Util.GetGitHashClientStructs(),
|
Util.GetGitHashClientStructs(),
|
||||||
FFXIVClientStructs.ThisAssembly.Git.Commits);
|
FFXIVClientStructs.ThisAssembly.Git.Commits);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ internal class DalamudCommands : IServiceType
|
||||||
|
|
||||||
chatGui.Print(new SeStringBuilder()
|
chatGui.Print(new SeStringBuilder()
|
||||||
.AddItalics("Dalamud:")
|
.AddItalics("Dalamud:")
|
||||||
.AddText($" D{Util.AssemblyVersion}({Util.GetGitHash()}")
|
.AddText($" D{Util.AssemblyVersion}({Util.GetScmVersion()}")
|
||||||
.Build());
|
.Build());
|
||||||
|
|
||||||
chatGui.Print(new SeStringBuilder()
|
chatGui.Print(new SeStringBuilder()
|
||||||
|
|
|
||||||
|
|
@ -821,7 +821,7 @@ internal class DalamudInterface : IInternalDisposableService
|
||||||
|
|
||||||
ImGui.MenuItem(Util.AssemblyVersion, false);
|
ImGui.MenuItem(Util.AssemblyVersion, false);
|
||||||
ImGui.MenuItem(this.dalamud.StartInfo.GameVersion?.ToString() ?? "Unknown version", false);
|
ImGui.MenuItem(this.dalamud.StartInfo.GameVersion?.ToString() ?? "Unknown version", false);
|
||||||
ImGui.MenuItem($"D: {Util.GetGitHash()}[{Util.GetGitCommitCount()}] CS: {Util.GetGitHashClientStructs()}[{FFXIVClientStructs.ThisAssembly.Git.Commits}]", false);
|
ImGui.MenuItem($"D: {Util.GetScmVersion()} CS: {Util.GetGitHashClientStructs()}[{FFXIVClientStructs.ThisAssembly.Git.Commits}]", false);
|
||||||
ImGui.MenuItem($"CLR: {Environment.Version}", false);
|
ImGui.MenuItem($"CLR: {Environment.Version}", false);
|
||||||
|
|
||||||
ImGui.EndMenu();
|
ImGui.EndMenu();
|
||||||
|
|
@ -1020,7 +1020,7 @@ internal class DalamudInterface : IInternalDisposableService
|
||||||
{
|
{
|
||||||
ImGui.PushFont(InterfaceManager.MonoFont);
|
ImGui.PushFont(InterfaceManager.MonoFont);
|
||||||
|
|
||||||
ImGui.BeginMenu($"{Util.GetGitHash()}({Util.GetGitCommitCount()})", false);
|
ImGui.BeginMenu(Util.GetScmVersion(), false);
|
||||||
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
|
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
|
||||||
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);
|
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);
|
||||||
ImGui.BeginMenu($"W:{Util.FormatBytes(GC.GetTotalMemory(false))}", false);
|
ImGui.BeginMenu($"W:{Util.FormatBytes(GC.GetTotalMemory(false))}", false);
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var versionInfo = t.Result;
|
var versionInfo = t.Result;
|
||||||
if (versionInfo.AssemblyVersion != Util.GetGitHash() &&
|
if (versionInfo.AssemblyVersion != Util.GetScmVersion() &&
|
||||||
versionInfo.Track != "release" &&
|
versionInfo.Track != "release" &&
|
||||||
string.Equals(versionInfo.Key, config.DalamudBetaKey, StringComparison.OrdinalIgnoreCase))
|
string.Equals(versionInfo.Key, config.DalamudBetaKey, StringComparison.OrdinalIgnoreCase))
|
||||||
this.staleDalamudNewVersion = versionInfo.AssemblyVersion;
|
this.staleDalamudNewVersion = versionInfo.AssemblyVersion;
|
||||||
|
|
@ -1540,7 +1540,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
DrawWarningIcon();
|
DrawWarningIcon();
|
||||||
DrawLinesCentered("A new version of Dalamud is available.\n" +
|
DrawLinesCentered("A new version of Dalamud is available.\n" +
|
||||||
"Please restart the game to ensure compatibility with updated plugins.\n" +
|
"Please restart the game to ensure compatibility with updated plugins.\n" +
|
||||||
$"old: {Util.GetGitHash()} new: {this.staleDalamudNewVersion}");
|
$"old: {Util.GetScmVersion()} new: {this.staleDalamudNewVersion}");
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(10);
|
ImGuiHelpers.ScaledDummy(10);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ internal static class BugBait
|
||||||
Reporter = reporter,
|
Reporter = reporter,
|
||||||
Name = plugin.InternalName,
|
Name = plugin.InternalName,
|
||||||
Version = isTesting ? plugin.TestingAssemblyVersion?.ToString() : plugin.AssemblyVersion.ToString(),
|
Version = isTesting ? plugin.TestingAssemblyVersion?.ToString() : plugin.AssemblyVersion.ToString(),
|
||||||
DalamudHash = Util.GetGitHash(),
|
DalamudHash = Util.GetScmVersion(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (includeException)
|
if (includeException)
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ public static class Troubleshooting
|
||||||
LoadedPlugins = pluginManager?.InstalledPlugins?.Select(x => x.Manifest as LocalPluginManifest)?.OrderByDescending(x => x.InternalName).ToArray(),
|
LoadedPlugins = pluginManager?.InstalledPlugins?.Select(x => x.Manifest as LocalPluginManifest)?.OrderByDescending(x => x.InternalName).ToArray(),
|
||||||
PluginStates = pluginManager?.InstalledPlugins?.Where(x => !x.IsDev).ToDictionary(x => x.Manifest.InternalName, x => x.IsBanned ? "Banned" : x.State.ToString()),
|
PluginStates = pluginManager?.InstalledPlugins?.Where(x => !x.IsDev).ToDictionary(x => x.Manifest.InternalName, x => x.IsBanned ? "Banned" : x.State.ToString()),
|
||||||
EverStartedLoadingPlugins = pluginManager?.InstalledPlugins.Where(x => x.HasEverStartedLoad).Select(x => x.InternalName).ToList(),
|
EverStartedLoadingPlugins = pluginManager?.InstalledPlugins.Where(x => x.HasEverStartedLoad).Select(x => x.InternalName).ToList(),
|
||||||
DalamudVersion = Util.AssemblyVersion,
|
DalamudVersion = Util.GetScmVersion(),
|
||||||
DalamudGitHash = Util.GetGitHash(),
|
DalamudGitHash = Util.GetGitHash() ?? "Unknown",
|
||||||
GameVersion = startInfo.GameVersion?.ToString() ?? "Unknown",
|
GameVersion = startInfo.GameVersion?.ToString() ?? "Unknown",
|
||||||
Language = startInfo.Language.ToString(),
|
Language = startInfo.Language.ToString(),
|
||||||
BetaKey = configuration.DalamudBetaKey,
|
BetaKey = configuration.DalamudBetaKey,
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ public static class Util
|
||||||
];
|
];
|
||||||
|
|
||||||
private static readonly Type GenericSpanType = typeof(Span<>);
|
private static readonly Type GenericSpanType = typeof(Span<>);
|
||||||
|
private static string? scmVersionInternal;
|
||||||
private static string? gitHashInternal;
|
private static string? gitHashInternal;
|
||||||
private static int? gitCommitCountInternal;
|
private static int? gitCommitCountInternal;
|
||||||
private static string? gitHashClientStructsInternal;
|
private static string? gitHashClientStructsInternal;
|
||||||
|
|
@ -127,11 +128,28 @@ public static class Util
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the git hash value from the assembly
|
/// Gets the SCM Version from the assembly, or null if it cannot be found. This method will generally return
|
||||||
/// or null if it cannot be found.
|
/// the <c>git describe</c> output for this build, which will be a raw version if this is a stable build or an
|
||||||
|
/// appropriately-annotated version if this is *not* stable. Local builds will return a `Local Build` text string.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The SCM version of the assembly.</returns>
|
||||||
|
public static string GetScmVersion()
|
||||||
|
{
|
||||||
|
if (scmVersionInternal != null) return scmVersionInternal;
|
||||||
|
|
||||||
|
var asm = typeof(Util).Assembly;
|
||||||
|
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
||||||
|
|
||||||
|
return scmVersionInternal = attrs.First(a => a.Key == "SCMVersion").Value
|
||||||
|
?? asm.GetName().Version!.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the git commit hash value from the assembly or null if it cannot be found. Will be null for Debug builds,
|
||||||
|
/// and will be suffixed with `-dirty` if in release with pending changes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The git hash of the assembly.</returns>
|
/// <returns>The git hash of the assembly.</returns>
|
||||||
public static string GetGitHash()
|
public static string? GetGitHash()
|
||||||
{
|
{
|
||||||
if (gitHashInternal != null)
|
if (gitHashInternal != null)
|
||||||
return gitHashInternal;
|
return gitHashInternal;
|
||||||
|
|
@ -139,15 +157,14 @@ public static class Util
|
||||||
var asm = typeof(Util).Assembly;
|
var asm = typeof(Util).Assembly;
|
||||||
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
||||||
|
|
||||||
gitHashInternal = attrs.First(a => a.Key == "GitHash").Value;
|
return gitHashInternal = attrs.First(a => a.Key == "GitHash").Value;
|
||||||
|
|
||||||
return gitHashInternal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the amount of commits in the current branch, or null if undetermined.
|
/// Gets the amount of commits in the current branch, or null if undetermined.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The amount of commits in the current branch.</returns>
|
/// <returns>The amount of commits in the current branch.</returns>
|
||||||
|
[Obsolete($"Planned for removal in API 11. Use {nameof(GetScmVersion)} for version tracking.")]
|
||||||
public static int? GetGitCommitCount()
|
public static int? GetGitCommitCount()
|
||||||
{
|
{
|
||||||
if (gitCommitCountInternal != null)
|
if (gitCommitCountInternal != null)
|
||||||
|
|
@ -169,7 +186,7 @@ public static class Util
|
||||||
/// or null if it cannot be found.
|
/// or null if it cannot be found.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The git hash of the assembly.</returns>
|
/// <returns>The git hash of the assembly.</returns>
|
||||||
public static string GetGitHashClientStructs()
|
public static string? GetGitHashClientStructs()
|
||||||
{
|
{
|
||||||
if (gitHashClientStructsInternal != null)
|
if (gitHashClientStructsInternal != null)
|
||||||
return gitHashClientStructsInternal;
|
return gitHashClientStructsInternal;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue