New: Multi target net framework 4.6.2 and net core 3.0

This commit is contained in:
ta264
2019-10-28 21:30:08 +00:00
parent 9f5dac3789
commit 4346c76d4f
99 changed files with 896 additions and 850 deletions
@@ -9,7 +9,8 @@ namespace NzbDrone.Common.EnvironmentInfo
public enum PlatformType
{
DotNet = 0,
Mono = 1
Mono = 1,
NetCore = 2
}
public interface IPlatformInfo
@@ -26,6 +27,10 @@ namespace NzbDrone.Common.EnvironmentInfo
static PlatformInfo()
{
#if NETCOREAPP3_0
_platform = PlatformType.NetCore;
_version = new Version("3.0");
#else
if (Type.GetType("Mono.Runtime") != null)
{
_platform = PlatformType.Mono;
@@ -36,11 +41,13 @@ namespace NzbDrone.Common.EnvironmentInfo
_platform = PlatformType.DotNet;
_version = GetDotNetVersion();
}
#endif
}
public static PlatformType Platform => _platform;
public static bool IsMono => Platform == PlatformType.Mono;
public static bool IsDotNet => Platform == PlatformType.DotNet;
public static bool IsNetCore => Platform == PlatformType.NetCore;
public static string PlatformName
{
@@ -50,8 +57,14 @@ namespace NzbDrone.Common.EnvironmentInfo
{
return ".NET";
}
return "Mono";
else if (IsMono)
{
return "Mono";
}
else
{
return ".NET Core";
}
}
}