From 31012ffecebc9d488aacae9c05a4e43cce65058f Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Wed, 6 May 2020 10:00:44 -0500 Subject: [PATCH] Remove references to PlatformAbstractions. (#5410) This will allow us to remove the PlatformAbstractions library from dotnet/runtime. Contributes to https://github.com/dotnet/runtime/issues/3470 --- eng/Versions.props | 1 - .../src/GetTargetMachineInfo.cs | 67 ------------------- ...Net.Build.Tasks.TargetFramework.Sdk.csproj | 1 - 3 files changed, 69 deletions(-) delete mode 100644 src/Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk/src/GetTargetMachineInfo.cs diff --git a/eng/Versions.props b/eng/Versions.props index 36e052addd8..1a7b225df5f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -26,7 +26,6 @@ 2.6.3 2.9.0 3.4.0 - 2.1.0 3.19.8 2.3.13 2.1.0 diff --git a/src/Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk/src/GetTargetMachineInfo.cs b/src/Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk/src/GetTargetMachineInfo.cs deleted file mode 100644 index 6edfd368b54..00000000000 --- a/src/Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk/src/GetTargetMachineInfo.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Build.Framework; -using System.Runtime.InteropServices; - -namespace Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk -{ - public class GetTargetMachineInfo : BuildTask - { - [Output] - public string TargetOS { get; set; } - - [Output] - public string TargetArch { get; set; } - - [Output] - public string RuntimeIdentifier { get; set; } - - public override bool ExecuteCore() - { - switch (RuntimeInformation.OSArchitecture) - { - case Architecture.X64: - TargetArch = "x64"; - break; - case Architecture.X86: - TargetArch = "x86"; - break; - case Architecture.Arm: - TargetArch = "arm"; - break; - case Architecture.Arm64: - TargetArch = "arm64"; - break; - } - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - TargetOS = "Windows_NT"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - TargetOS = "Linux"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - TargetOS = "OSX"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))) - TargetOS = "FreeBSD"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))) - TargetOS = "NetBSD"; - - RuntimeIdentifier = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - if (TargetArch == null) - { - Log.LogError("{0} is null", nameof(TargetArch)); - return false; - } - - if (TargetOS == null) - { - Log.LogError("{0} is null", nameof(TargetOS)); - return false; - } - - return true; - } - } -} diff --git a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj index 99a1df06eb2..aad22bef22b 100644 --- a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj +++ b/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.csproj @@ -23,7 +23,6 @@ -