normalize slashes and casing when comparing includes
This commit is contained in:
parent
4e3c73e778
commit
6a703ffa73
3 changed files with 15 additions and 7 deletions
|
@ -66,7 +66,16 @@ namespace Microsoft.DotNet.Tools
|
|||
|
||||
public static bool HasInclude(this ProjectItemElement el, string include)
|
||||
{
|
||||
return el.Includes().Contains(include);
|
||||
include = NormalizeIncludeForComparison(include);
|
||||
foreach (var i in el.Includes())
|
||||
{
|
||||
if (include == NormalizeIncludeForComparison(i))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool TryGetFrameworkConditionString(string framework, out string condition)
|
||||
|
@ -80,5 +89,10 @@ namespace Microsoft.DotNet.Tools
|
|||
condition = $"'$(TargetFramework)' == '{framework}'";
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string NormalizeIncludeForComparison(string include)
|
||||
{
|
||||
return P2PHelpers.NormalizeSlashesForMsbuild(include.ToLower());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.Build.Construction;
|
||||
using Microsoft.DotNet.Tools.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Add.ProjectToProjectReference
|
||||
{
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
using Microsoft.DotNet.Cli.CommandLine;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.Build.Construction;
|
||||
using Microsoft.DotNet.Tools.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Remove.ProjectToProjectReference
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue