Class NuGetManager
Implements
Inherited Members
Namespace: LemonEdge.NuGetManager
Assembly: LemonEdge.NuGetManager.dll
Syntax
public class NuGetManager : INuGetManager
Constructors
NuGetManager(INuGetPackageManager, INuGetConfigManager, ILocalsCommandRunner, IOptions<NuGetSettings>, ILogger<NuGetManager>)
Declaration
public NuGetManager(INuGetPackageManager nuGetPackageManager, INuGetConfigManager configManager, ILocalsCommandRunner localsCommandRunner, IOptions<NuGetSettings> nugetSettings, ILogger<NuGetManager> logger)
Parameters
Type | Name | Description |
---|---|---|
INuGetPackageManager | nuGetPackageManager | |
INuGetConfigManager | configManager | |
ILocalsCommandRunner | localsCommandRunner | |
IOptions<NuGetSettings> | nugetSettings | |
ILogger<NuGetManager> | logger |
Methods
ClearLocalCache()
Clears the local NuGet cache
Declaration
public void ClearLocalCache()
CreateNuGetPackage(string, string, bool)
Creates an instance of NuGetPackage
Declaration
public NuGetPackage CreateNuGetPackage(string name, string version, bool isPreRelease = false)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the package |
string | version | The version string (i.e. , 1.2., 2.*, etc.) |
bool | isPreRelease | If pre-release packages should be considered |
Returns
Type | Description |
---|---|
NuGetPackage |
DownloadAndInstallNuGetPackageAsync(NuGetPackage, CancellationToken)
Downloads a given package name and its dependencies.
Declaration
public Task<Dictionary<string, string>> DownloadAndInstallNuGetPackageAsync(NuGetPackage nuGetPackage, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
NuGetPackage | nuGetPackage | A nuGet package to download NuGetPackage |
CancellationToken | token | The cancellation token |
Returns
Type | Description |
---|---|
Task<Dictionary<string, string>> | A collection of file-paths to each installed NuGet package |
DownloadAndInstallNuGetPackagesAsync(IEnumerable<NuGetPackage>, CancellationToken)
Downloads a collection of packages and their dependencies.
Declaration
public Task<Dictionary<string, string>> DownloadAndInstallNuGetPackagesAsync(IEnumerable<NuGetPackage> nuGetPackages, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<NuGetPackage> | nuGetPackages | A collection of nuGet packages to download NuGetPackage |
CancellationToken | token | The cancellation token |
Returns
Type | Description |
---|---|
Task<Dictionary<string, string>> | A collection of nuget package names and file-paths for each installed NuGet package |