From 2f30287365fdb1bc5915aacba13e190e20263a6a Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Thu, 6 Feb 2020 16:14:22 -0800 Subject: [PATCH] Use NETCOREAPP This changes all of our uses of `NETCOREAPP3_1` to `NETCOREAPP`. There is no value in distinguishing the exact .NET Core version we use in our source tree as we only target one version. Also going forward it's not expected that our .NET Core specific code will be version specific. If that arises we can go back to version specific defines for those cases. This also removes the last references to `netcoreapp1.1`, `netcoreapp2.1` and `netcoreapp3.0` from our code. --- src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs | 2 +- .../Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs | 2 +- src/Compilers/CSharp/Test/WinRT/PEParameterSymbolTests.cs | 2 +- src/Compilers/Shared/CoreClrAnalyzerAssemblyLoader.cs | 2 +- src/Compilers/Shared/NamedPipeUtil.cs | 2 +- src/Compilers/Shared/RuntimeHostInfo.cs | 2 +- src/Compilers/Shared/ShadowCopyAnalyzerAssemblyLoader.cs | 4 ++-- src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs | 6 +++--- .../Portable/Platform/CoreClr/CoreCLRRuntimeEnvironment.cs | 2 +- .../Platform/CoreClr/CoreCLRRuntimeEnvironmentFactory.cs | 2 +- .../Portable/Platform/CoreClr/SharedConsoleOutWriter.cs | 2 +- .../Portable/Platform/CoreClr/TestExecutionLoadContext.cs | 2 +- src/Tools/BuildBoss/ProjectCheckerUtil.cs | 2 -- 13 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs index 8858887bb50..9ac9f511098 100644 --- a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs +++ b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs @@ -5849,7 +5849,7 @@ public void BinaryFileErrorTest() CleanupAllGeneratedFiles(binaryPath); } -#if !NETCOREAPP3_1 +#if !NETCOREAPP [WorkItem(530221, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530221")] [WorkItem(5660, "https://github.com/dotnet/roslyn/issues/5660")] [ConditionalFact(typeof(WindowsOnly), typeof(IsEnglishLocal))] diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs b/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs index 35d927f6fee..a2fcaa288ec 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs @@ -2270,7 +2270,7 @@ internal void Goo() } } -#if !NETCOREAPP3_1 +#if !NETCOREAPP [ConditionalFact(typeof(WindowsDesktopOnly), Reason = ConditionalSkipReason.TestExecutionNeedsDesktopTypes)] [WorkItem(399, "https://github.com/dotnet/roslyn/issues/399")] public void Bug399() diff --git a/src/Compilers/CSharp/Test/WinRT/PEParameterSymbolTests.cs b/src/Compilers/CSharp/Test/WinRT/PEParameterSymbolTests.cs index d29ee8cba38..3167ad13af2 100644 --- a/src/Compilers/CSharp/Test/WinRT/PEParameterSymbolTests.cs +++ b/src/Compilers/CSharp/Test/WinRT/PEParameterSymbolTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Symbols { public class PEParameterSymbolTests : CSharpTestBase { -#if !NETCOREAPP3_1 +#if !NETCOREAPP [Fact] public void NoParameterNames() { diff --git a/src/Compilers/Shared/CoreClrAnalyzerAssemblyLoader.cs b/src/Compilers/Shared/CoreClrAnalyzerAssemblyLoader.cs index 4e2d54c570e..e384f662cba 100644 --- a/src/Compilers/Shared/CoreClrAnalyzerAssemblyLoader.cs +++ b/src/Compilers/Shared/CoreClrAnalyzerAssemblyLoader.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if NETCOREAPP3_1 +#if NETCOREAPP using System.Diagnostics; using System.Reflection; diff --git a/src/Compilers/Shared/NamedPipeUtil.cs b/src/Compilers/Shared/NamedPipeUtil.cs index 9fdc7eecb77..4a05ac39756 100644 --- a/src/Compilers/Shared/NamedPipeUtil.cs +++ b/src/Compilers/Shared/NamedPipeUtil.cs @@ -166,7 +166,7 @@ internal static bool CheckPipeConnectionOwnership(NamedPipeClientStream pipeStre return security; } -#elif NETCOREAPP3_1 +#elif NETCOREAPP private static PipeOptions CurrentUserOption = PipeOptions.CurrentUserOnly; diff --git a/src/Compilers/Shared/RuntimeHostInfo.cs b/src/Compilers/Shared/RuntimeHostInfo.cs index ce4296e5651..b7811ed9dd0 100644 --- a/src/Compilers/Shared/RuntimeHostInfo.cs +++ b/src/Compilers/Shared/RuntimeHostInfo.cs @@ -53,7 +53,7 @@ internal static bool IsDotNetHost([NotNullWhen(true)] out string? pathToDotNet) internal static NamedPipeClientStream CreateNamedPipeClient(string serverName, string pipeName, PipeDirection direction, PipeOptions options) => new NamedPipeClientStream(serverName, pipeName, direction, options); -#elif NETCOREAPP3_1 +#elif NETCOREAPP internal static bool IsDesktopRuntime => false; private static string DotNetHostPathEnvironmentName = "DOTNET_HOST_PATH"; diff --git a/src/Compilers/Shared/ShadowCopyAnalyzerAssemblyLoader.cs b/src/Compilers/Shared/ShadowCopyAnalyzerAssemblyLoader.cs index 0a17ab0f11e..46cb768c955 100644 --- a/src/Compilers/Shared/ShadowCopyAnalyzerAssemblyLoader.cs +++ b/src/Compilers/Shared/ShadowCopyAnalyzerAssemblyLoader.cs @@ -9,8 +9,8 @@ using System.Threading; using System.Threading.Tasks; -// The ShadowCopyAnalyzerAssemblyLoader derives from DesktopAnalyzerAssemblyLoader (NET472) OR CoreClrAnalyzerAssemblyLoader (NETCOREAPP3_1) -#if NET472 || NETCOREAPP3_1 +// The ShadowCopyAnalyzerAssemblyLoader derives from DesktopAnalyzerAssemblyLoader (NET472) OR CoreClrAnalyzerAssemblyLoader (NETCOREAPP) +#if NET472 || NETCOREAPP namespace Microsoft.CodeAnalysis { diff --git a/src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs b/src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs index b030f1958f1..2fdcbdb809d 100644 --- a/src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs +++ b/src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs @@ -20,7 +20,7 @@ public static partial class RuntimeUtilities internal static bool IsDesktopRuntime => #if NET472 true; -#elif NETCOREAPP3_1 +#elif NETCOREAPP false; #elif NETSTANDARD2_0 throw new PlatformNotSupportedException(); @@ -51,7 +51,7 @@ internal static IRuntimeEnvironmentFactory GetRuntimeEnvironmentFactory() { #if NET472 return new Roslyn.Test.Utilities.Desktop.DesktopRuntimeEnvironmentFactory(); -#elif NETCOREAPP3_1 +#elif NETCOREAPP return new Roslyn.Test.Utilities.CoreClr.CoreCLRRuntimeEnvironmentFactory(); #elif NETSTANDARD2_0 throw new PlatformNotSupportedException(); @@ -64,7 +64,7 @@ internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader() { #if NET472 return new DesktopAnalyzerAssemblyLoader(); -#elif NETCOREAPP3_1 +#elif NETCOREAPP return new CoreClrAnalyzerAssemblyLoader(); #elif NETSTANDARD2_0 return new ThrowingAnalyzerAssemblyLoader(); diff --git a/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironment.cs b/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironment.cs index 5064977865c..81059bd30b3 100644 --- a/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironment.cs +++ b/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironment.cs @@ -1,7 +1,7 @@ // 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. -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using System.Linq; using System.Collections.Generic; diff --git a/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironmentFactory.cs b/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironmentFactory.cs index 697be60593e..53ad88114a6 100644 --- a/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironmentFactory.cs +++ b/src/Test/Utilities/Portable/Platform/CoreClr/CoreCLRRuntimeEnvironmentFactory.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using System.Collections.Generic; diff --git a/src/Test/Utilities/Portable/Platform/CoreClr/SharedConsoleOutWriter.cs b/src/Test/Utilities/Portable/Platform/CoreClr/SharedConsoleOutWriter.cs index bc6af49462d..93146b8cedf 100644 --- a/src/Test/Utilities/Portable/Platform/CoreClr/SharedConsoleOutWriter.cs +++ b/src/Test/Utilities/Portable/Platform/CoreClr/SharedConsoleOutWriter.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using System.IO; diff --git a/src/Test/Utilities/Portable/Platform/CoreClr/TestExecutionLoadContext.cs b/src/Test/Utilities/Portable/Platform/CoreClr/TestExecutionLoadContext.cs index 9d8cdfc111e..1efd25958d8 100644 --- a/src/Test/Utilities/Portable/Platform/CoreClr/TestExecutionLoadContext.cs +++ b/src/Test/Utilities/Portable/Platform/CoreClr/TestExecutionLoadContext.cs @@ -1,7 +1,7 @@ // 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. -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/src/Tools/BuildBoss/ProjectCheckerUtil.cs b/src/Tools/BuildBoss/ProjectCheckerUtil.cs index e76919ef73f..87cfac92677 100644 --- a/src/Tools/BuildBoss/ProjectCheckerUtil.cs +++ b/src/Tools/BuildBoss/ProjectCheckerUtil.cs @@ -323,8 +323,6 @@ private bool CheckTargetFrameworks(TextWriter textWriter) { case "net20": case "net472": - case "netcoreapp2.1": - case "netcoreapp3.0": case "netcoreapp3.1": case "$(RoslynPortableTargetFrameworks)": continue; -- GitLab