public Task <T> Find <T>(PackageDescriptor descriptor) where T : class, IPackage { if (_package is T package) { return(Task.FromResult(package)); } return(default);
public Package2( PackageDescriptor descriptor, IDirectoryAccessor directoryAccessor) { _descriptor = descriptor ?? throw new ArgumentNullException(nameof(descriptor)); DirectoryAccessor = directoryAccessor ?? throw new ArgumentNullException(nameof(directoryAccessor)); }
public Task <PackageBuilder> Locate(PackageDescriptor packageDescriptor, Budget budget) { var directory = new DirectoryInfo(Path.Combine( Package.DefaultPackagesDirectory.FullName, packageDescriptor.Name)); if (directory.Exists) { var packageBuilder = new PackageBuilder(packageDescriptor.Name); packageBuilder.CreateRebuildablePackage = _createRebuildablePackage; return(Task.FromResult(packageBuilder)); } return(Task.FromResult <PackageBuilder>(null)); }
public Task <PackageBuilder> Locate( PackageDescriptor packageDescriptor, Budget budget = null) { var projectFile = packageDescriptor.Name; var extension = Path.GetExtension(projectFile); if ((extension == ".csproj" || extension == ".fsproj") && File.Exists(projectFile)) { PackageBuilder packageBuilder = new PackageBuilder(packageDescriptor.Name); packageBuilder.CreateRebuildablePackage = _createRebuildablePackage; packageBuilder.Directory = new DirectoryInfo(Path.GetDirectoryName(projectFile)); return(Task.FromResult(packageBuilder)); } return(Task.FromResult <PackageBuilder>(null)); }