adjust lock file check to handle NuGet-style lock file

fixes #970
This commit is contained in:
Andrew Stanton-Nurse 2016-01-22 10:22:53 -08:00
parent fc9097459e
commit 43d57e438e

View file

@ -60,7 +60,9 @@ namespace Microsoft.DotNet.ProjectModel.Graph
// If the framework name is empty, the associated dependencies are shared by all frameworks // If the framework name is empty, the associated dependencies are shared by all frameworks
if (group.FrameworkName == null) if (group.FrameworkName == null)
{ {
actualDependencies = project.Dependencies.Select(RenderDependency).OrderBy(x => x); actualDependencies = project.Dependencies
.Select(RenderDependency)
.OrderBy(x => x, StringComparer.OrdinalIgnoreCase);
} }
else else
{ {
@ -71,7 +73,9 @@ namespace Microsoft.DotNet.ProjectModel.Graph
return false; return false;
} }
actualDependencies = framework.Dependencies.Select(RenderDependency).OrderBy(x => x); actualDependencies = framework.Dependencies
.Select(RenderDependency)
.OrderBy(x => x, StringComparer.OrdinalIgnoreCase);
} }
if (!actualDependencies.SequenceEqual(expectedDependencies)) if (!actualDependencies.SequenceEqual(expectedDependencies))
@ -84,16 +88,6 @@ namespace Microsoft.DotNet.ProjectModel.Graph
return true; return true;
} }
private string RenderDependency(LibraryRange arg) private string RenderDependency(LibraryRange arg) => $"{arg.Name} {VersionUtility.RenderVersion(arg.VersionRange)}";
{
var name = arg.Name;
if (arg.Target == LibraryType.ReferenceAssembly)
{
name = $"fx/{name}";
}
return $"{name} {VersionUtility.RenderVersion(arg.VersionRange)}";
}
} }
} }