Exemplo n.º 1
0
 public void Install(string packageName, string version, string nugetSourceUrl)
 {
     _workingDirectoriesProvider.CreateTempDirectory(restoreTempDirectory => {
         _nugetManager.RestoreToDirectory(packageName, version, nugetSourceUrl, restoreTempDirectory, true);
         _workingDirectoriesProvider.CreateTempDirectory(zipTempDirectory => {
             var restoreTempDirectoryInfo = new DirectoryInfo(restoreTempDirectory);
             string packagePath           = Path.Combine(zipTempDirectory,
                                                         _packageArchiver.GetPackedGroupPackagesFileName(restoreTempDirectoryInfo.Name));
             _packageArchiver.ZipPackages(restoreTempDirectory, packagePath, true);
             _packageInstaller.Install(packagePath);
         });
     });
 }
Exemplo n.º 2
0
 public void Install(IEnumerable <NugetPackageFullName> nugetPackageFullNames, string nugetSourceUrl)
 {
     _workingDirectoriesProvider.CreateTempDirectory(restoreTempDirectory => {
         foreach (NugetPackageFullName nugetPackageFullName in nugetPackageFullNames)
         {
             _nugetManager.RestoreToDirectory(nugetPackageFullName, nugetSourceUrl, restoreTempDirectory, true);
         }
         _workingDirectoriesProvider.CreateTempDirectory(zipTempDirectory => {
             var restoreTempDirectoryInfo = new DirectoryInfo(restoreTempDirectory);
             string packagePath           = Path.Combine(zipTempDirectory,
                                                         _packageArchiver.GetPackedGroupPackagesFileName(restoreTempDirectoryInfo.Name));
             _packageArchiver.ZipPackages(restoreTempDirectory, packagePath, true);
             _packageInstaller.Install(packagePath);
         });
     });
 }