38 references to Platform
Microsoft.DotNet.Cli.Utils (35)
RuntimeEnvironment.cs (35)
20private static readonly Lazy<Platform> _platform = new(DetermineOSPlatform); 23public static Platform OperatingSystemPlatform { get; } = GetOSPlatform(); 37case Platform.Windows: 38return nameof(Platform.Windows); 39case Platform.Linux: 40return GetDistroId() ?? nameof(Platform.Linux); 41case Platform.Darwin: 43case Platform.FreeBSD: 44return nameof(Platform.FreeBSD); 45case Platform.illumos: 46return GetDistroId() ?? nameof(Platform.illumos); 47case Platform.Solaris: 48return nameof(Platform.Solaris); 49case Platform.Haiku: 50return nameof(Platform.Haiku); 52return nameof(Platform.Unknown); 60case Platform.Windows: 62case Platform.Linux: 63case Platform.illumos: 65case Platform.Darwin: 67case Platform.Solaris: 71case Platform.FreeBSD: 72case Platform.Haiku: 80private static Platform GetOSPlatform() 99case Platform.Linux: 101case Platform.illumos: 215private static Platform DetermineOSPlatform() 219return Platform.Windows; 223return Platform.Linux; 227return Platform.Darwin; 232return Platform.FreeBSD; 236return Platform.illumos; 240return Platform.Solaris; 244return Platform.Haiku; 248return Platform.Unknown;
Microsoft.DotNet.Cli.Utils.Tests (3)
RuntimeEnvironmentTests.cs (3)
15Assert.Equal(Platform.Windows, RuntimeEnvironment.OperatingSystemPlatform); 31Assert.Equal(Platform.Darwin, RuntimeEnvironment.OperatingSystemPlatform); 47Assert.Equal(Platform.Linux, RuntimeEnvironment.OperatingSystemPlatform);