You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.3 KiB
57 lines
1.3 KiB
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace NzbDrone.Common.EnvironmentInfo
|
|
{
|
|
public static class BuildInfo
|
|
{
|
|
static BuildInfo()
|
|
{
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
|
|
Version = assembly.GetName().Version;
|
|
|
|
var attributes = assembly.GetCustomAttributes(true);
|
|
|
|
Branch = "unknow";
|
|
|
|
var config = attributes.OfType<AssemblyConfigurationAttribute>().FirstOrDefault();
|
|
if (config != null)
|
|
{
|
|
Branch = config.Configuration;
|
|
}
|
|
|
|
Release = $"{Version}-{Branch}";
|
|
}
|
|
|
|
public static string AppName { get; } = "Sonarr";
|
|
|
|
public static Version Version { get; }
|
|
public static string Branch { get; }
|
|
public static string Release { get; }
|
|
|
|
public static DateTime BuildDateTime
|
|
{
|
|
get
|
|
{
|
|
var fileLocation = Assembly.GetCallingAssembly().Location;
|
|
return new FileInfo(fileLocation).LastWriteTimeUtc;
|
|
}
|
|
}
|
|
|
|
public static bool IsDebug
|
|
{
|
|
get
|
|
{
|
|
#if DEBUG
|
|
return true;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
}
|