Ejemplo n.º 1
0
        public void RestoreToNugetFileStorage(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                              string destinationNupkgDirectory)
        {
            CheckArguments(nugetPackageFullName, nugetSourceUrl);
            string result = Restore(nugetPackageFullName, nugetSourceUrl, destinationNupkgDirectory);

            _logger.WriteLine(result);
        }
Ejemplo n.º 2
0
 public void RestoreToPackageStorage(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                     string destinationNupkgDirectory, bool overwrite)
 {
     CheckArguments(nugetPackageFullName, nugetSourceUrl);
     RestoreToDirectory(nugetPackageFullName, nugetSourceUrl, destinationNupkgDirectory,
                        gzipPackedPackagesFiles => {
         _packageArchiver.Unpack(gzipPackedPackagesFiles, overwrite, destinationNupkgDirectory);
     });
 }
Ejemplo n.º 3
0
 public void RestoreToDirectory(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                string destinationNupkgDirectory, bool overwrite)
 {
     CheckArguments(nugetPackageFullName, nugetSourceUrl);
     RestoreToDirectory(nugetPackageFullName, nugetSourceUrl, destinationNupkgDirectory,
                        gzipPackedPackagesFiles => {
         _fileSystem.Copy(gzipPackedPackagesFiles, destinationNupkgDirectory, overwrite);
     });
 }
Ejemplo n.º 4
0
 private string Restore(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl, string destinationDirectory)
 {
     destinationDirectory = _fileSystem.GetCurrentDirectoryIfEmpty(destinationDirectory);
     return(_workingDirectoriesProvider.CreateTempDirectory(tempDirectory => {
         string version = nugetPackageFullName.Version == PackageVersion.LastVersion
                                 ? GetLastVersionPackage(nugetPackageFullName.Name, nugetSourceUrl)
                                 : nugetPackageFullName.Version;
         string nugetRestoreProjPath = Path.Combine(tempDirectory, NugetRestoreProjName);
         CreateNugetRestoreProj(nugetRestoreProjPath, nugetPackageFullName.Name, version);
         string result = RestorePackage(nugetRestoreProjPath, nugetSourceUrl, destinationDirectory)
                         .Replace(nugetRestoreProjPath, $"\"{destinationDirectory}\"");
         return result;
     }));
 }
Ejemplo n.º 5
0
        private void RestoreToDirectory(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                        string destinationNupkgDirectory, Action <IEnumerable <string> > onRestored)
        {
            string result = string.Empty;

            _workingDirectoriesProvider.CreateTempDirectory(restoreTempDirectory => {
                result = Restore(nugetPackageFullName, nugetSourceUrl, restoreTempDirectory)
                         .Replace(restoreTempDirectory, $"{destinationNupkgDirectory}");
                _logger.WriteLine(result);
                IEnumerable <string> gzipPackedPackagesFiles =
                    _packageArchiver.FindGzipPackedPackagesFiles(restoreTempDirectory);
                onRestored(gzipPackedPackagesFiles);
            });
        }
Ejemplo n.º 6
0
 private static void CheckArguments(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl)
 {
     nugetPackageFullName.CheckArgumentNull(nameof(nugetPackageFullName));
     nugetSourceUrl.CheckArgumentNullOrWhiteSpace(nameof(nugetSourceUrl));
 }
Ejemplo n.º 7
0
 public void RestoreToPackageStorage(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                     string destinationDirectory, bool overwrite) =>
 _nugetPackageRestorer.RestoreToPackageStorage(nugetPackageFullName, nugetSourceUrl,
                                               destinationDirectory, overwrite);
Ejemplo n.º 8
0
 public void RestoreToNugetFileStorage(NugetPackageFullName nugetPackageFullName, string nugetSourceUrl,
                                       string destinationDirectory) =>
 _nugetPackageRestorer.RestoreToNugetFileStorage(nugetPackageFullName, nugetSourceUrl, destinationDirectory);
Ejemplo n.º 9
0
 public bool Equals(NugetPackageFullName packageFullName)
 {
     return(Equals(packageFullName, this));
 }