mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-10 17:31:59 +00:00
37 lines
1.7 KiB
C#
37 lines
1.7 KiB
C#
using System.Reflection;
|
|
|
|
namespace Ryujinx.Common
|
|
{
|
|
// DO NOT EDIT, filled by CI
|
|
public static class ReleaseInformation
|
|
{
|
|
private const string FlatHubChannel = "flathub";
|
|
private const string CanaryChannel = "canary";
|
|
private const string ReleaseChannel = "release";
|
|
|
|
private const string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
|
|
public const string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
|
|
private const string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
|
|
private const string ConfigFileName = "%%RYUJINX_CONFIG_FILE_NAME%%";
|
|
|
|
public const string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
|
|
public const string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";
|
|
|
|
public static string ConfigName => !ConfigFileName.StartsWith("%%") ? ConfigFileName : "Config.json";
|
|
|
|
public static bool IsValid =>
|
|
!BuildGitHash.StartsWith("%%") &&
|
|
!ReleaseChannelName.StartsWith("%%") &&
|
|
!ReleaseChannelOwner.StartsWith("%%") &&
|
|
!ReleaseChannelRepo.StartsWith("%%") &&
|
|
!ConfigFileName.StartsWith("%%");
|
|
|
|
public static bool IsFlatHubBuild => IsValid && ReleaseChannelOwner.Equals(FlatHubChannel);
|
|
|
|
public static bool IsCanaryBuild => IsValid && ReleaseChannelName.Equals(CanaryChannel);
|
|
|
|
public static bool IsReleaseBuild => IsValid && ReleaseChannelName.Equals(ReleaseChannel);
|
|
|
|
public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
|
}
|
|
}
|