This change mimics the nuget lock file generation logic
This commit is contained in:
parent
f7cba8a630
commit
302a9e84f7
2 changed files with 44 additions and 11 deletions
|
@ -61,7 +61,7 @@ namespace Microsoft.DotNet.ProjectModel.Graph
|
|||
if (group.FrameworkName == null)
|
||||
{
|
||||
actualDependencies = project.Dependencies
|
||||
.Select(RenderDependency)
|
||||
.Select(d => d.ToLockFileDependencyGroupString())
|
||||
.OrderBy(x => x, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
else
|
||||
|
@ -74,7 +74,7 @@ namespace Microsoft.DotNet.ProjectModel.Graph
|
|||
}
|
||||
|
||||
actualDependencies = framework.Dependencies
|
||||
.Select(RenderDependency)
|
||||
.Select(d => d.ToLockFileDependencyGroupString())
|
||||
.OrderBy(x => x, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
|
@ -87,14 +87,5 @@ namespace Microsoft.DotNet.ProjectModel.Graph
|
|||
message = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
private string RenderDependency(LibraryRange arg)
|
||||
{
|
||||
if (arg.Target == LibraryType.Project && arg.VersionRange == null)
|
||||
{
|
||||
return arg.Name;
|
||||
}
|
||||
return $"{arg.Name} {VersionUtility.RenderVersion(arg.VersionRange)}";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue