Merge pull request #1411 from dotnet/davidfowl/new-nuget
Updated to a newer version of NuGet
This commit is contained in:
commit
f7cba8a630
9 changed files with 34 additions and 24 deletions
|
@ -88,6 +88,13 @@ namespace Microsoft.DotNet.ProjectModel.Graph
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string RenderDependency(LibraryRange arg) => $"{arg.Name} {VersionUtility.RenderVersion(arg.VersionRange)}";
|
private string RenderDependency(LibraryRange arg)
|
||||||
|
{
|
||||||
|
if (arg.Target == LibraryType.Project && arg.VersionRange == null)
|
||||||
|
{
|
||||||
|
return arg.Name;
|
||||||
|
}
|
||||||
|
return $"{arg.Name} {VersionUtility.RenderVersion(arg.VersionRange)}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -175,7 +175,7 @@ namespace Microsoft.DotNet.ProjectModel
|
||||||
var libraries = new Dictionary<LibraryKey, LibraryDescription>();
|
var libraries = new Dictionary<LibraryKey, LibraryDescription>();
|
||||||
var projectResolver = new ProjectDependencyProvider(ProjectResolver);
|
var projectResolver = new ProjectDependencyProvider(ProjectResolver);
|
||||||
|
|
||||||
var mainProject = projectResolver.GetDescription(TargetFramework, Project);
|
var mainProject = projectResolver.GetDescription(TargetFramework, Project, targetLibrary: null);
|
||||||
|
|
||||||
// Add the main project
|
// Add the main project
|
||||||
libraries.Add(new LibraryKey(mainProject.Identity.Name), mainProject);
|
libraries.Add(new LibraryKey(mainProject.Identity.Name), mainProject);
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace Microsoft.DotNet.ProjectModel.Resolution
|
||||||
var project = _resolveProject(Path.GetDirectoryName(path));
|
var project = _resolveProject(Path.GetDirectoryName(path));
|
||||||
if (project != null)
|
if (project != null)
|
||||||
{
|
{
|
||||||
return GetDescription(targetLibrary.TargetFramework, project);
|
return GetDescription(targetLibrary.TargetFramework, project, targetLibrary);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -40,30 +40,40 @@ namespace Microsoft.DotNet.ProjectModel.Resolution
|
||||||
return GetDescription(name, path, targetLibrary, projectCacheResolver: null);
|
return GetDescription(name, path, targetLibrary, projectCacheResolver: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectDescription GetDescription(NuGetFramework targetFramework, Project project)
|
public ProjectDescription GetDescription(NuGetFramework targetFramework, Project project, LockFileTargetLibrary targetLibrary)
|
||||||
{
|
{
|
||||||
// This never returns null
|
// This never returns null
|
||||||
var targetFrameworkInfo = project.GetTargetFramework(targetFramework);
|
var targetFrameworkInfo = project.GetTargetFramework(targetFramework);
|
||||||
var targetFrameworkDependencies = new List<LibraryRange>(targetFrameworkInfo.Dependencies);
|
var dependencies = new List<LibraryRange>(targetFrameworkInfo.Dependencies);
|
||||||
|
|
||||||
if (targetFramework != null && targetFramework.IsDesktop())
|
if (targetFramework != null && targetFramework.IsDesktop())
|
||||||
{
|
{
|
||||||
targetFrameworkDependencies.Add(new LibraryRange("mscorlib", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
dependencies.Add(new LibraryRange("mscorlib", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
||||||
|
|
||||||
targetFrameworkDependencies.Add(new LibraryRange("System", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
dependencies.Add(new LibraryRange("System", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
||||||
|
|
||||||
if (targetFramework.Version >= new Version(3, 5))
|
if (targetFramework.Version >= new Version(3, 5))
|
||||||
{
|
{
|
||||||
targetFrameworkDependencies.Add(new LibraryRange("System.Core", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
dependencies.Add(new LibraryRange("System.Core", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
||||||
|
|
||||||
if (targetFramework.Version >= new Version(4, 0))
|
if (targetFramework.Version >= new Version(4, 0))
|
||||||
{
|
{
|
||||||
targetFrameworkDependencies.Add(new LibraryRange("Microsoft.CSharp", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
dependencies.Add(new LibraryRange("Microsoft.CSharp", LibraryType.ReferenceAssembly, LibraryDependencyType.Build));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var dependencies = project.Dependencies.Concat(targetFrameworkDependencies).ToList();
|
// Add all of the project's dependencies
|
||||||
|
dependencies.AddRange(project.Dependencies);
|
||||||
|
|
||||||
|
if (targetLibrary != null)
|
||||||
|
{
|
||||||
|
// The lock file entry might have a filtered set of dependencies
|
||||||
|
var lockFileDependencies = targetLibrary.Dependencies.ToDictionary(d => d.Id);
|
||||||
|
|
||||||
|
// Remove all non-framework dependencies that don't appear in the lock file entry
|
||||||
|
dependencies.RemoveAll(m => !lockFileDependencies.ContainsKey(m.Name) && m.Target != LibraryType.ReferenceAssembly);
|
||||||
|
}
|
||||||
|
|
||||||
// Mark the library as unresolved if there were specified frameworks
|
// Mark the library as unresolved if there were specified frameworks
|
||||||
// and none of them resolved
|
// and none of them resolved
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"description": "Types to model a .NET Project",
|
"description": "Types to model a .NET Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Reflection.Metadata": "1.2.0-rc3-23811",
|
"System.Reflection.Metadata": "1.2.0-rc3-23811",
|
||||||
"NuGet.Packaging": "3.4.0-beta-583",
|
"NuGet.Packaging": "3.4.0-beta-625",
|
||||||
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15996",
|
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15996",
|
||||||
"Microsoft.Extensions.JsonParser.Sources": {
|
"Microsoft.Extensions.JsonParser.Sources": {
|
||||||
"type": "build",
|
"type": "build",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"Microsoft.CodeAnalysis.CSharp": "1.2.0-beta1-20160202-02",
|
"Microsoft.CodeAnalysis.CSharp": "1.2.0-beta1-20160202-02",
|
||||||
"Microsoft.DiaSymReader.Native": "1.3.3",
|
"Microsoft.DiaSymReader.Native": "1.3.3",
|
||||||
|
|
||||||
"NuGet.CommandLine.XPlat": "3.4.0-beta-583",
|
"NuGet.CommandLine.XPlat": "3.4.0-beta-625",
|
||||||
"System.CommandLine": "0.1.0-e160119-1",
|
"System.CommandLine": "0.1.0-e160119-1",
|
||||||
|
|
||||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
||||||
|
@ -47,10 +47,7 @@
|
||||||
"version": "1.0.0-rc2-16453",
|
"version": "1.0.0-rc2-16453",
|
||||||
"type": "build"
|
"type": "build"
|
||||||
},
|
},
|
||||||
"Microsoft.Extensions.Testing.Abstractions": {
|
"Microsoft.Extensions.Testing.Abstractions": "1.0.0-*",
|
||||||
"version": "1.0.0-*",
|
|
||||||
"type": "build"
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.ConsoleHost": "1.0.0-rc2-23811",
|
"Microsoft.NETCore.ConsoleHost": "1.0.0-rc2-23811",
|
||||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23811",
|
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23811",
|
||||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
|
|
||||||
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
||||||
"Microsoft.DotNet.Cli.Utils": {
|
"Microsoft.DotNet.Cli.Utils": {
|
||||||
"target": "project",
|
"target": "project"
|
||||||
"type": "build"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"xunit": "2.1.0",
|
"xunit": "2.1.0",
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
|
|
||||||
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
||||||
"Microsoft.DotNet.Cli.Utils": {
|
"Microsoft.DotNet.Cli.Utils": {
|
||||||
"target": "project",
|
"target": "project"
|
||||||
"type": "build"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"xunit": "2.1.0",
|
"xunit": "2.1.0",
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||||
|
|
||||||
"Microsoft.DotNet.Cli.Utils": {
|
"Microsoft.DotNet.Cli.Utils": {
|
||||||
"target": "project",
|
"target": "project"
|
||||||
"type": "build"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"dotnet": { "target": "project" },
|
"dotnet": { "target": "project" },
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
|
|
||||||
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
||||||
"Microsoft.DotNet.Cli.Utils": {
|
"Microsoft.DotNet.Cli.Utils": {
|
||||||
"target": "project",
|
"target": "project"
|
||||||
"type": "build"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"xunit": "2.1.0",
|
"xunit": "2.1.0",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue