From 090038675efb1e86f8b2408f0c458dee46acb715 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Wed, 7 Oct 2020 08:57:13 +0530 Subject: [PATCH] Miscellaneous refactors in source files Simplify `#ifdef` logic (across source code) Normalize and Fix namespaces (in Test projects) --- src/Shared/FileUtilities.cs | 7 +++---- src/Tasks.UnitTests/GenerateBindingRedirects_Tests.cs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Shared/FileUtilities.cs b/src/Shared/FileUtilities.cs index f942b9da01b..6ffe950235e 100644 --- a/src/Shared/FileUtilities.cs +++ b/src/Shared/FileUtilities.cs @@ -4,6 +4,8 @@ using System; #if !CLR2COMPATIBILITY using System.Collections.Concurrent; +#else +using Microsoft.Build.Shared.Concurrent; #endif using System.Collections.Generic; using System.Diagnostics; @@ -107,11 +109,8 @@ public static bool GetIsFileSystemCaseSensitive() internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); -#if !CLR2COMPATIBILITY private static readonly ConcurrentDictionary FileExistenceCache = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); -#else - private static readonly Microsoft.Build.Shared.Concurrent.ConcurrentDictionary FileExistenceCache = new Microsoft.Build.Shared.Concurrent.ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); -#endif + private static readonly IFileSystem DefaultFileSystem = FileSystems.Default; /// diff --git a/src/Tasks.UnitTests/GenerateBindingRedirects_Tests.cs b/src/Tasks.UnitTests/GenerateBindingRedirects_Tests.cs index b764f4d7869..22e3eb6a34c 100644 --- a/src/Tasks.UnitTests/GenerateBindingRedirects_Tests.cs +++ b/src/Tasks.UnitTests/GenerateBindingRedirects_Tests.cs @@ -13,7 +13,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.Build.Tasks.Unittest +namespace Microsoft.Build.Tasks.UnitTests { public class GenerateBindingRedirectsTests : IDisposable {