Ejemplo n.º 1
0
 public ApplyDeltaCommand(ILog log, IFreeSpaceChecker freeSpaceChecker, ICalamariFileSystem fileSystem, ICommandLineRunner commandLineRunner)
 {
     this.freeSpaceChecker  = freeSpaceChecker;
     this.fileSystem        = fileSystem;
     this.commandLineRunner = commandLineRunner;
     this.log = log;
     Options.Add("basisFileName=", "The file that the delta was created for.", v => basisFileName = v);
     Options.Add("fileHash=", "", v => fileHash = v);
     Options.Add("deltaFileName=", "The delta to apply to the basis file", v => deltaFileName  = v);
     Options.Add("newFileName=", "The file to write the result to.", v => newFileName          = v);
     Options.Add("progress", "Whether progress should be written to stdout", v => showProgress = true);
     Options.Add("skipVerification",
                 "Skip checking whether the basis file is the same as the file used to produce the signature that created the delta.",
                 v => skipVerification = true);
 }
Ejemplo n.º 2
0
 public PackageDownloaderStrategy(
     ILog log,
     IScriptEngine engine,
     ICalamariFileSystem fileSystem,
     IFreeSpaceChecker freeSpaceChecker,
     ICommandLineRunner commandLineRunner,
     IVariables variables
     )
 {
     this.log               = log;
     this.engine            = engine;
     this.fileSystem        = fileSystem;
     this.freeSpaceChecker  = freeSpaceChecker;
     this.commandLineRunner = commandLineRunner;
     this.variables         = variables;
 }
Ejemplo n.º 3
0
        public DownloadPackageCommand(
            IScriptEngine scriptEngine,
            IFreeSpaceChecker freeSpaceChecker,
            IVariables variables,
            ICalamariFileSystem fileSystem,
            ICommandLineRunner commandLineRunner,
            ILog log)
        {
            this.scriptEngine     = scriptEngine;
            this.freeSpaceChecker = freeSpaceChecker;
            this.variables        = variables;
            this.fileSystem       = fileSystem;
            this.log = log;
            this.commandLineRunner = commandLineRunner;
            Options.Add("packageId=", "Package ID to download", v => packageId = v);
            Options.Add("packageVersion=", "Package version to download", v => packageVersion = v);
            Options.Add("packageVersionFormat=", $"[Optional] Format of version. Options {string.Join(", ", Enum.GetNames(typeof(VersionFormat)))}. Defaults to `{VersionFormat.Semver}`.",
                        v =>
            {
                if (!Enum.TryParse(v, out VersionFormat format))
                {
                    throw new CommandException($"The provided version format `{format}` is not recognised.");
                }
                versionFormat = format;
            });
            Options.Add("feedId=", "Id of the NuGet feed", v => feedId = v);
            Options.Add("feedUri=", "URL to NuGet feed", v => feedUri  = v);
            Options.Add("feedUsername="******"[Optional] Username to use for an authenticated NuGet feed", v => feedUsername = v);
            Options.Add("feedPassword="******"[Optional] Password to use for an authenticated NuGet feed", v => feedPassword = v);
            Options.Add("feedType=", $"[Optional] Type of feed. Options {string.Join(", ", Enum.GetNames(typeof(FeedType)))}. Defaults to `{FeedType.NuGet}`.",
                        v =>
            {
                if (!Enum.TryParse(v, out FeedType type))
                {
                    throw new CommandException($"The provided feed type `{type}` is not recognised.");
                }

                feedType = type;
            });
            Options.Add("attempts=", $"[Optional] The number of times to attempt downloading the package. Default: {maxDownloadAttempts}", v => maxDownloadAttempts = v);
            Options.Add("attemptBackoffSeconds=", $"[Optional] The number of seconds to apply as a linear backoff between each download attempt. Default: {attemptBackoffSeconds}", v => attemptBackoffSeconds = v);
            Options.Add("forcePackageDownload", "[Optional, Flag] if specified, the package will be downloaded even if it is already in the package cache", v => forcePackageDownload = true);
        }
Ejemplo n.º 4
0
 public NuGetPackageDownloader(ICalamariFileSystem fileSystem, IFreeSpaceChecker freeSpaceChecker)
 {
     this.fileSystem       = fileSystem;
     this.freeSpaceChecker = freeSpaceChecker;
 }
 public NuGetPackageDownloader(ICalamariFileSystem fileSystem, IFreeSpaceChecker freeSpaceChecker, IVariables variables)
 {
     this.fileSystem       = fileSystem;
     this.freeSpaceChecker = freeSpaceChecker;
     this.variables        = variables;
 }
Ejemplo n.º 6
0
 public GitHubPackageDownloader(ILog log, ICalamariFileSystem fileSystem, IFreeSpaceChecker freeSpaceChecker)
 {
     this.log              = log;
     this.fileSystem       = fileSystem;
     this.freeSpaceChecker = freeSpaceChecker;
 }