ReleaseInformations.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Reflection;
  2. namespace Ryujinx.Common
  3. {
  4. // DO NOT EDIT, filled by CI
  5. public static class ReleaseInformations
  6. {
  7. public static string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
  8. public static string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
  9. public static string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
  10. public static string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
  11. public static string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";
  12. public static bool IsValid()
  13. {
  14. return !BuildGitHash.StartsWith("%%") &&
  15. !ReleaseChannelName.StartsWith("%%") &&
  16. !ReleaseChannelOwner.StartsWith("%%") &&
  17. !ReleaseChannelRepo.StartsWith("%%");
  18. }
  19. public static string GetVersion()
  20. {
  21. if (IsValid())
  22. {
  23. return BuildVersion;
  24. }
  25. else
  26. {
  27. return Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
  28. }
  29. }
  30. }
  31. }