public InstallBuilder(Runtime.Project project, IPackageBuilder packageBuilder, Reports buildReport) { _project = project; _packageBuilder = packageBuilder; _buildReport = buildReport; IsApplicationPackage = project.Commands.Any(); }
public Reports CreateReports(bool verbose, bool quiet) { var useConsoleColor = _runtimeEnv.OperatingSystem == "Windows"; IReport output = new Report(AnsiConsole.GetOutput(useConsoleColor)); var reports = new Reports() { Information = output, Verbose = verbose ? output : new NullReport(), Error = new Report(AnsiConsole.GetError(useConsoleColor)), }; // If "--verbose" and "--quiet" are specified together, "--verbose" wins reports.Quiet = quiet ? reports.Verbose : output; return reports; }
public static IPackageFeed CreatePackageFolderFromPath(string path, bool ignoreFailedSources, Reports reports) { Func<string, bool> containsNupkg = dir => Directory.Exists(dir) && Directory.EnumerateFiles(dir, "*" + Constants.PackageExtension) .Where(x => !Path.GetFileNameWithoutExtension(x).EndsWith(".symbols")) .Any(); if (Directory.Exists(path) && (containsNupkg(path) || Directory.EnumerateDirectories(path).Any(x => containsNupkg(x)))) { return new NuGetPackageFolder(path, reports); } else { return new PackageFolder(path, ignoreFailedSources, reports); } }
public static IPackageFeed CreatePackageFeed(PackageSource source, bool noCache, bool ignoreFailedSources, Reports reports) { if (new Uri(source.Source).IsFile) { return PackageFolderFactory.CreatePackageFolderFromPath(source.Source, ignoreFailedSources, reports); } else { var httpSource = new HttpSource( source.Source, source.UserName, source.Password, reports); Uri packageBaseAddress; if (NuGetv3Feed.DetectNuGetV3(httpSource, noCache, out packageBaseAddress)) { if (packageBaseAddress == null) { reports.Information.WriteLine( $"Ignoring NuGet v3 feed {source.Source.Yellow().Bold()}, which doesn't provide PackageBaseAddress resource."); return null; } httpSource = new HttpSource( packageBaseAddress.AbsoluteUri, source.UserName, source.Password, reports); return new NuGetv3Feed( httpSource, noCache, reports, ignoreFailedSources); } return new NuGetv2Feed( httpSource, noCache, reports, ignoreFailedSources); } }
public static IPackageFeed CreatePackageFeed(PackageSource source, bool noCache, bool ignoreFailedSources, Reports reports) { if (new Uri(source.Source).IsFile) { return PackageFolderFactory.CreatePackageFolderFromPath(source.Source, ignoreFailedSources, reports); } else { return new NuGetv2Feed( source.Source, source.UserName, source.Password, noCache, reports, ignoreFailedSources); } }
public static IPackageFeed CreatePackageFeed(PackageSource source, bool noCache, bool ignoreFailedSources, Reports reports) { if (new Uri(source.Source).IsFile) { return PackageFolderFactory.CreatePackageFolderFromPath(source.Source, ignoreFailedSources, reports); } else { // TODO: temporarily ignore NuGet v3 feeds if (source.Source.EndsWith(".json")) { return null; } return new NuGetv2Feed( source.Source, source.UserName, source.Password, noCache, reports, ignoreFailedSources); } }
private Reports CreateReports(bool verbose, bool quiet) { IReport output = new Report(AnsiConsole.Output); var reports = new Reports() { Information = output, Verbose = verbose ? output : new NullReport(), Error = new Report(AnsiConsole.Output), }; // If "--verbose" and "--quiet" are specified together, "--verbose" wins reports.Quiet = quiet ? reports.Verbose : output; return reports; }
public UninstallCommand(IAppCommandsRepository commandsRepo, Reports reports) { _commandsRepo = commandsRepo; _reports = reports; }
public UninstallCommand(IApplicationEnvironment applicationEnvironment, IAppCommandsRepository commandsRepo, Reports reports) { _environment = applicationEnvironment; _commandsRepo = commandsRepo; _reports = reports; }
public ListFeedsCommand(Reports reports, string targetDirectory) { Reports = reports; TargetDirectory = targetDirectory; }
public static IPackageFeed CreatePackageFolderFromPath(string path, bool ignoreFailedSources, Reports reports) { Func <string, bool> containsNupkg = dir => Directory.Exists(dir) && Directory.EnumerateFiles(dir, "*" + Constants.PackageExtension) .Where(x => !Path.GetFileNameWithoutExtension(x).EndsWith(".symbols")) .Any(); if (Directory.Exists(path) && (containsNupkg(path) || Directory.EnumerateDirectories(path).Any(x => containsNupkg(x)))) { return(new NuGetPackageFolder(path, reports)); } else { return(new KpmPackageFolder(path, ignoreFailedSources, reports)); } }