From 3aa390c3af7f53fecf2d9ba701b7571cc84bb147 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Mon, 4 May 2020 16:38:40 -0500 Subject: [PATCH 1/4] Remove references to PlatformAbstractions. This will allow us to remove the PlatformAbstractions library from dotnet/runtime. I needed to update the SDK used so I can use the new RuntimeInformation.RuntimeIdentifier API that is only in .NET 5. Contributes to https://github.com/dotnet/runtime/issues/3470 --- Directory.Build.props | 14 ++--- Directory.Build.targets | 20 ------- eng/Build.props | 3 +- eng/Signing.props | 15 ----- global.json | 2 +- src/windowsdesktop/Directory.Build.targets | 6 +- tools-local/tasks/GetTargetMachineInfo.cs | 67 ---------------------- tools-local/tasks/local.tasks.csproj | 1 - 8 files changed, 8 insertions(+), 120 deletions(-) delete mode 100644 tools-local/tasks/GetTargetMachineInfo.cs diff --git a/Directory.Build.props b/Directory.Build.props index a67312c42..a5ddc8ace 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -47,10 +47,6 @@ $(LocalBuildToolsTaskDir)local.tasks.dll - - $(ObjDir)HostMachineInfo.props - - diff --git a/Directory.Build.targets b/Directory.Build.targets index c6dd4f565..ca73eab05 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -61,26 +61,6 @@ - - - - - - - -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <HostMachineRid>$(HostMachineRid)</HostMachineRid> - </PropertyGroup> -</Project> - - - - - - diff --git a/eng/Build.props b/eng/Build.props index 306be1b57..3bb6145c9 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -79,8 +79,7 @@ Properties="RepoRoot=$(RepoRoot)" Targets=" Restore; - Build; - CreateHostMachineInfoFile"/> + Build"/> - - - - - - - - - - - - - - - diff --git a/global.json b/global.json index 34dc55ac8..97d605a7e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "3.1.101" + "dotnet": "5.0.100-preview.5.20228.8" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20201.2", diff --git a/src/windowsdesktop/Directory.Build.targets b/src/windowsdesktop/Directory.Build.targets index b329a1ebb..2a4116204 100644 --- a/src/windowsdesktop/Directory.Build.targets +++ b/src/windowsdesktop/Directory.Build.targets @@ -57,12 +57,8 @@ - - - - - $(_HostRid) + $(HostRuntimeIdentifier) $(MSBuildProjectName) $(ArtifactsDir)tests/$(ConfigurationGroup)/ diff --git a/tools-local/tasks/GetTargetMachineInfo.cs b/tools-local/tasks/GetTargetMachineInfo.cs deleted file mode 100644 index 67aa53b36..000000000 --- a/tools-local/tasks/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 -{ - 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 Execute() - { - 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/tools-local/tasks/local.tasks.csproj b/tools-local/tasks/local.tasks.csproj index 3fc5e54be..4eac498ff 100644 --- a/tools-local/tasks/local.tasks.csproj +++ b/tools-local/tasks/local.tasks.csproj @@ -17,7 +17,6 @@ - From ea807fbe2d430884eb4b549a712ad284014baade Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Mon, 4 May 2020 16:54:13 -0500 Subject: [PATCH 2/4] Remove leftover UsingTask --- Directory.Build.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index ca73eab05..b5bcca96e 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -6,7 +6,6 @@ - From 5e17b7524c18b4b9a5f65c8fd4b23b00493c7674 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Mon, 4 May 2020 17:04:24 -0500 Subject: [PATCH 3/4] Add back CrossGenRootPath to sign binaries --- eng/Signing.props | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/Signing.props b/eng/Signing.props index d37bb9b50..5e580448c 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -23,6 +23,10 @@ + + + + From 6681b4520770f89e65fdfbd06fd5ec86daadbbd2 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Mon, 4 May 2020 17:32:58 -0500 Subject: [PATCH 4/4] Fix the tests by updating the TFM to 5.0 --- src/windowsdesktop/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/windowsdesktop/Directory.Build.props b/src/windowsdesktop/Directory.Build.props index 4b971c5b5..8ce121e2c 100644 --- a/src/windowsdesktop/Directory.Build.props +++ b/src/windowsdesktop/Directory.Build.props @@ -9,7 +9,7 @@ $(ObjDir)TestNuGetConfig\NuGet.config $(ObjDir)ExtraNupkgsForTestRestore\ $(TargetArchitecture) - netcoreapp3.0 + netcoreapp5.0