(61d00a474) v0.9.7.1

This commit is contained in:
Regalis
2020-03-04 13:04:10 +01:00
parent 3c50efa5c9
commit 3c09ebe02f
5086 changed files with 786063 additions and 295871 deletions
@@ -0,0 +1,46 @@
using System.Linq;
using System.Reflection;
public static class AssemblyInfo
{
/// <summary> Gets the git hash value from the assembly
/// or null if it cannot be found. </summary>
public static string GetGitRevision()
{
var asm = typeof(AssemblyInfo).Assembly;
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
return attrs.FirstOrDefault(a => a.Key == "GitRevision")?.Value;
}
/// <summary> Gets the git branch name from the assembly
/// or null if it cannot be found. </summary>
public static string GetGitBranch()
{
var asm = typeof(AssemblyInfo).Assembly;
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
return attrs.FirstOrDefault(a => a.Key == "GitBranch")?.Value;
}
/// <summary> Gets the build platform and configuration </summary>
public static string GetBuildString()
{
string retVal = "Unknown";
#if WINDOWS
retVal = "Windows";
#elif OSX
retVal = "Mac";
#elif LINUX
retVal = "Linux";
#endif
#if DEBUG
retVal = "Debug" + retVal;
#elif UNSTABLE
retVal = "Unstable" + retVal;
#else
retVal = "Release" + retVal;
#endif
return retVal;
}
}