From 5d3b35345cfe0d48ff3b72bbe816a7c23c1d359e Mon Sep 17 00:00:00 2001 From: Chris Weldon Date: Thu, 8 Apr 2021 16:24:09 -0500 Subject: [PATCH 1/3] Helping the building of the Graph be case insensitive. --- Common/DotGraphUtilities/DotGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/DotGraphUtilities/DotGraph.cs b/Common/DotGraphUtilities/DotGraph.cs index b78afc1..d82b277 100644 --- a/Common/DotGraphUtilities/DotGraph.cs +++ b/Common/DotGraphUtilities/DotGraph.cs @@ -18,7 +18,7 @@ public static class DotGraph { public static IDictionary> LoadDependencyGraph(string targetFile) { - IDictionary> result = new SortedDictionary>(); + IDictionary> result = new SortedDictionary>(StringComparer.InvariantCultureIgnoreCase); IEnumerable validDigraphLines = ParseForValidDigraphLines(targetFile); From b0113b7bb8c661dfa52b480e631d0c3ed51b9b4e Mon Sep 17 00:00:00 2001 From: Chris Weldon Date: Thu, 8 Apr 2021 16:30:40 -0500 Subject: [PATCH 2/3] Ensuring projects in the digraph are compared in a case insensitive manner. --- .../ProcessParallelAbility/ParallelAbility.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ProcessParallelAbility/ProcessParallelAbility/ParallelAbility.cs b/ProcessParallelAbility/ProcessParallelAbility/ParallelAbility.cs index 068a432..5dfdb7a 100644 --- a/ProcessParallelAbility/ProcessParallelAbility/ParallelAbility.cs +++ b/ProcessParallelAbility/ProcessParallelAbility/ParallelAbility.cs @@ -6,6 +6,7 @@ namespace ProcessParallelAbility { + using System; using System.Collections.Generic; using System.Linq; @@ -40,7 +41,7 @@ internal static IDictionary> ConvertParallelTreeToLevels(IDict /// A structure in which the Key is the project and the value is the depth within the given dependency tree. internal static IDictionary ResolveParallelTree(IDictionary> dependencyTree) { - IDictionary parallelBuildTree = new Dictionary(); + IDictionary parallelBuildTree = new Dictionary(StringComparer.InvariantCultureIgnoreCase); foreach (KeyValuePair> dotGraphEntry in dependencyTree) { From f0e9d57b608ef75344f259d71bca2f6c33a2ae55 Mon Sep 17 00:00:00 2001 From: Chris Weldon Date: Thu, 8 Apr 2021 16:51:39 -0500 Subject: [PATCH 3/3] Adding one additional point that requires Case Insensitive comparison. --- .../MSBPRDependencyGraph.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MsBuildProjectReferenceDependencyGraph/MSBPRDependencyGraph.cs b/MsBuildProjectReferenceDependencyGraph/MSBPRDependencyGraph.cs index 0774091..2226039 100644 --- a/MsBuildProjectReferenceDependencyGraph/MSBPRDependencyGraph.cs +++ b/MsBuildProjectReferenceDependencyGraph/MSBPRDependencyGraph.cs @@ -6,6 +6,7 @@ namespace MsBuildProjectReferenceDependencyGraph { + using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; @@ -26,7 +27,7 @@ class MSBPRDependencyGraph internal static Dictionary> ResolveProjectReferenceDependencies(IEnumerable targetProjects) { Stack unresolvedProjects = new Stack(); - Dictionary> resolvedProjects = new Dictionary>(); + Dictionary> resolvedProjects = new Dictionary>(StringComparer.InvariantCultureIgnoreCase); // Load up the initial projects to the stack foreach (string targetProject in targetProjects.Distinct()) @@ -279,7 +280,7 @@ internal static Dictionary> ResolveAssemblyReference ); // Convert this into the Dictionary - Dictionary> result = new Dictionary>(); + Dictionary> result = new Dictionary>(StringComparer.InvariantCultureIgnoreCase); foreach (KeyValuePair> kvp in resolvedAssemblyReferences) { result.Add(kvp.Key, kvp.Value); @@ -307,7 +308,7 @@ internal static Dictionary> ResolvePackageReferenceD ); // Convert this into the Dictionary - Dictionary> result = new Dictionary>(); + Dictionary> result = new Dictionary>(StringComparer.InvariantCultureIgnoreCase); foreach (KeyValuePair> kvp in resolvedPackageReferences) { result.Add(kvp.Key, kvp.Value);