aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Common')
-rw-r--r--Ryujinx.Common/Logging/Targets/FileLogTarget.cs2
-rw-r--r--Ryujinx.Common/ReleaseInformations.cs32
2 files changed, 33 insertions, 1 deletions
diff --git a/Ryujinx.Common/Logging/Targets/FileLogTarget.cs b/Ryujinx.Common/Logging/Targets/FileLogTarget.cs
index 5591c60b..e83b26cd 100644
--- a/Ryujinx.Common/Logging/Targets/FileLogTarget.cs
+++ b/Ryujinx.Common/Logging/Targets/FileLogTarget.cs
@@ -30,7 +30,7 @@ namespace Ryujinx.Common.Logging
files[i].Delete();
}
- string version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
+ string version = ReleaseInformations.GetVersion();
// Get path for the current time
path = Path.Combine(logDir.FullName, $"Ryujinx_{version}_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.log");
diff --git a/Ryujinx.Common/ReleaseInformations.cs b/Ryujinx.Common/ReleaseInformations.cs
new file mode 100644
index 00000000..1dcb4bf3
--- /dev/null
+++ b/Ryujinx.Common/ReleaseInformations.cs
@@ -0,0 +1,32 @@
+namespace Ryujinx.Common
+{
+ // DO NOT EDIT, filled by CI
+ public static class ReleaseInformations
+ {
+ public static string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
+ public static string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
+ public static string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
+ public static string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
+ public static string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";
+
+ public static bool IsValid()
+ {
+ return !BuildGitHash.StartsWith("%%") &&
+ !ReleaseChannelName.StartsWith("%%") &&
+ !ReleaseChannelOwner.StartsWith("%%") &&
+ !ReleaseChannelRepo.StartsWith("%%");
+ }
+
+ public static string GetVersion()
+ {
+ if (IsValid())
+ {
+ return BuildVersion;
+ }
+ else
+ {
+ return "1.0.0-dirty";
+ }
+ }
+ }
+}