2022-03-04 17:03:16 +00:00
|
|
|
using System.Reflection;
|
2022-01-24 17:49:14 +00:00
|
|
|
|
|
|
|
namespace Ryujinx.Common
|
2022-01-22 16:56:09 +00:00
|
|
|
{
|
|
|
|
// DO NOT EDIT, filled by CI
|
2023-01-07 08:06:13 +00:00
|
|
|
public static class ReleaseInformation
|
2022-01-22 16:56:09 +00:00
|
|
|
{
|
2022-03-04 17:03:16 +00:00
|
|
|
private const string FlatHubChannelOwner = "flathub";
|
|
|
|
|
2024-01-29 18:58:18 +00:00
|
|
|
private const string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
|
|
|
|
private const string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
|
|
|
|
private const string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
|
|
|
|
private const string ConfigFileName = "%%RYUJINX_CONFIG_FILE_NAME%%";
|
|
|
|
|
2023-06-28 17:41:38 +01:00
|
|
|
public const string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
|
|
|
|
public const string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";
|
2022-01-22 16:56:09 +00:00
|
|
|
|
2024-01-29 18:58:18 +00:00
|
|
|
public static string ConfigName => !ConfigFileName.StartsWith("%%") ? ConfigFileName : "Config.json";
|
2023-06-28 17:41:38 +01:00
|
|
|
|
2024-01-29 18:58:18 +00:00
|
|
|
public static bool IsValid =>
|
|
|
|
!BuildGitHash.StartsWith("%%") &&
|
|
|
|
!ReleaseChannelName.StartsWith("%%") &&
|
|
|
|
!ReleaseChannelOwner.StartsWith("%%") &&
|
|
|
|
!ReleaseChannelRepo.StartsWith("%%") &&
|
|
|
|
!ConfigFileName.StartsWith("%%");
|
2022-03-04 17:03:16 +00:00
|
|
|
|
2024-01-29 18:58:18 +00:00
|
|
|
public static bool IsFlatHubBuild => IsValid && ReleaseChannelOwner.Equals(FlatHubChannelOwner);
|
2022-03-04 17:03:16 +00:00
|
|
|
|
2024-01-29 18:58:18 +00:00
|
|
|
public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
2022-01-22 16:56:09 +00:00
|
|
|
}
|
2023-06-28 17:41:38 +01:00
|
|
|
}
|