aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-12-06 22:20:22 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-12-06 22:20:22 -0600
commit63be411f989425a3ecfbba83ad7e706841fdc224 (patch)
tree6e4380636d43405d8cc1bf1bb4aa01082d2d39d3 /src
parent943016bc9fcdd47721bb3eb0e40b8bbf2359acbc (diff)
downloadslskd-63be411f989425a3ecfbba83ad7e706841fdc224.tar.gz
switch to FullVersion and SemanticVersion
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Program.cs40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 79c012bb..5d81c5a5 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -74,50 +74,44 @@ namespace slskd
public static readonly string DefaultAppDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify), AppName);
/// <summary>
- /// Gets the assembly version of the application.
+ /// Gets the unique Id of this application invocation.
/// </summary>
+ public static readonly Guid InvocationId = Guid.NewGuid();
+
+ /// <summary>
+ /// Gets the Id of the current application process.
+ /// </summary>
+ public static readonly int ProcessId = Environment.ProcessId;
+
/// <remarks>
/// Inaccurate when running locally.
/// </remarks>
- public static readonly Version AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.Equals(new Version(1, 0, 0, 0)) ? new Version(0, 0, 0, 0) : Assembly.GetExecutingAssembly().GetName().Version;
+ private static readonly Version AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.Equals(new Version(1, 0, 0, 0)) ? new Version(0, 0, 0, 0) : Assembly.GetExecutingAssembly().GetName().Version;
- /// <summary>
- /// Gets the informational version of the application, including the git sha at the latest commit.
- /// </summary>
/// <remarks>
/// Inaccurate when running locally.
/// </remarks>
- public static readonly string InformationalVersion = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion == "1.0.0" ? "0.0.0" : Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
+ private static readonly string InformationalVersion = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion == "1.0.0" ? "0.0.0" : Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
/// <summary>
- /// Gets the full application version, including both assembly and informational versions.
+ /// Occurs when a new log event is emitted.
/// </summary>
- public static readonly string FullVersion = $"{AssemblyVersion} ({InformationalVersion})";
+ public static event EventHandler<LogRecord> LogEmitted;
/// <summary>
/// Gets the semantic application version.
/// </summary>
- public static readonly string SemanticVersion = InformationalVersion.Split('-').First();
-
- /// <summary>
- /// Gets a value indicating whether the current version is a Canary build.
- /// </summary>
- public static readonly bool IsCanary = AssemblyVersion.Revision == 65534;
-
- /// <summary>
- /// Gets the unique Id of this application invocation.
- /// </summary>
- public static readonly Guid InvocationId = Guid.NewGuid();
+ public static string SemanticVersion => InformationalVersion.Split('-').First();
/// <summary>
- /// Gets the Id of the current application process.
+ /// Gets the full application version, including both assembly and informational versions.
/// </summary>
- public static readonly int ProcessId = Environment.ProcessId;
+ public static string FullVersion => $"{SemanticVersion} ({InformationalVersion})";
/// <summary>
- /// Occurs when a new log event is emitted.
+ /// Gets a value indicating whether the current version is a Canary build.
/// </summary>
- public static event EventHandler<LogRecord> LogEmitted;
+ public static bool IsCanary => AssemblyVersion.Revision == 65534;
/// <summary>
/// Gets the path where application data is saved.