-
Notifications
You must be signed in to change notification settings - Fork 253
[Spec] Package download API
Zhi Li edited this page Sep 21, 2017
·
13 revisions
Msbuild SDK Resolver need an API From NuGet which can download nuget package to specified path by passing package Id and version.
The goal of this API is to provider a high level interface (supports cross-platform) to download nuget package directly and return the package path.
- It will be a static utility method in project NuGet.Commands
public static string DownloadPackage(string packageId, string version, string targetFramework, string root, string configFile)
- Package Id Type: String
- Package version (can be floating version) Type: String
- Target Framework Type: String or NuGetFramework
- NuGet Setting Root Path Type: String
- NuGet Config File Path Type: String
- NoCache
- Prerelease
- DependencyBehavior
Package Path for the package which is passed as parameter
-
How to discover Package source, Package Credential?
This API will use NuGet.Config to get Package Source information
- User pass NuGet.Config file to the API, then it will use this specified NuGet.Config
- If No NuGet.Config passed and Root path is null or empty, it will load NuGet.Config from Appdata and ProgramData
- If No NuGet.Config passed and Root path is not null, it will load every Nuget.Config from Root Path to Driver root and also load NuGet.Config from Appdata and ProgramData.
- How to specify where the package is downloaded to? (TBD)
- Choice 1: user can specify the globalPackages Folder in NuGet.Config, it user this path as installed Path.
- Choice 2: user can pass the path to this API.
- How to consume this API?
- Reference NuGet.Commands or NuGet.Commands.Xplat package in their project.
- NuGet provides a msbuild task to call this API. (need a msbuild task spec for this)
- Does NuGet need to support downloading multiple packages in one call?
- Does NuGet need to provide a way to find all dependency packages after the top package downloaded?
Check out the proposals in the accepted
& proposed
folders on the repository, and active PRs for proposals being discussed today.