|
1 | 1 | using System.Diagnostics.CodeAnalysis; |
| 2 | +using System.Runtime.InteropServices; |
2 | 3 | using BenchmarkDotNet.Detectors; |
3 | 4 | using BenchmarkDotNet.Environments; |
4 | 5 | using BenchmarkDotNet.Extensions; |
5 | | -using BenchmarkDotNet.Portability; |
6 | 6 | using JetBrains.Annotations; |
7 | | -#if NETSTANDARD |
8 | | -using Microsoft.DotNet.PlatformAbstractions; |
9 | | -#endif |
10 | 7 |
|
11 | 8 | namespace BenchmarkDotNet.Toolchains.DotNetCli |
12 | 9 | { |
@@ -64,7 +61,7 @@ protected string GetTargetFrameworkMoniker() |
64 | 61 | { |
65 | 62 | if (targetFrameworkMoniker.IsNotBlank()) |
66 | 63 | return targetFrameworkMoniker; |
67 | | - if (!RuntimeInformation.IsNetCore) |
| 64 | + if (!Portability.RuntimeInformation.IsNetCore) |
68 | 65 | throw new NotSupportedException("You must specify the target framework moniker in explicit way using builder.TargetFrameworkMoniker(tfm) method"); |
69 | 66 |
|
70 | 67 | return CoreRuntime.GetCurrentVersion().MsBuildMoniker; |
@@ -130,12 +127,7 @@ internal static string GetPortableRuntimeIdentifier() |
130 | 127 | // the values taken from https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids |
131 | 128 | string osPart = OsDetector.IsWindows() ? "win" : (OsDetector.IsMacOS() ? "osx" : "linux"); |
132 | 129 |
|
133 | | - string architecture = |
134 | | -#if NETSTANDARD |
135 | | - RuntimeEnvironment.RuntimeArchitecture; |
136 | | -#else |
137 | | - System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); |
138 | | -#endif |
| 130 | + string architecture = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); |
139 | 131 |
|
140 | 132 | return $"{osPart}-{architecture}"; |
141 | 133 | } |
|
0 commit comments