コード例 #1
0
ファイル: InstallBuilder.cs プロジェクト: elanwu123/dnx
 public InstallBuilder(Runtime.Project project, IPackageBuilder packageBuilder, Reports buildReport)
 {
     _project = project;
     _packageBuilder = packageBuilder;
     _buildReport = buildReport;
     IsApplicationPackage = project.Commands.Any();
 }
コード例 #2
0
ファイル: ReportsFactory.cs プロジェクト: noahfalk/dnx
        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;
        }
コード例 #3
0
ファイル: PackageFolderFactory.cs プロジェクト: elanwu123/dnx
        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);
            }
        }
コード例 #4
0
ファイル: PackageSourceUtils.cs プロジェクト: noahfalk/dnx
        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);
            }
        }
コード例 #5
0
ファイル: PackageSourceUtils.cs プロジェクト: nagyistoce/dnx
 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);
     }
 }
コード例 #6
0
ファイル: PackageSourceUtils.cs プロジェクト: elanwu123/dnx
        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);
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: nagyistoce/dnx
        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;
        }
コード例 #8
0
 public UninstallCommand(IAppCommandsRepository commandsRepo, Reports reports)
 {
     _commandsRepo = commandsRepo;
     _reports      = reports;
 }
コード例 #9
0
ファイル: UninstallCommand.cs プロジェクト: elanwu123/dnx
 public UninstallCommand(IApplicationEnvironment applicationEnvironment, IAppCommandsRepository commandsRepo, Reports reports)
 {
     _environment = applicationEnvironment;
     _commandsRepo = commandsRepo;
     _reports = reports;
 }
コード例 #10
0
 public UninstallCommand(IApplicationEnvironment applicationEnvironment, IAppCommandsRepository commandsRepo, Reports reports)
 {
     _environment  = applicationEnvironment;
     _commandsRepo = commandsRepo;
     _reports      = reports;
 }
コード例 #11
0
 public ListFeedsCommand(Reports reports, string targetDirectory)
 {
     Reports         = reports;
     TargetDirectory = targetDirectory;
 }
コード例 #12
0
        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));
            }
        }
コード例 #13
0
 public InstallBuilder(Runtime.Project project, IPackageBuilder packageBuilder, Reports buildReport)
 {
     _project             = project;
     _packageBuilder      = packageBuilder;
     _buildReport         = buildReport;
     IsApplicationPackage = project.Commands.Any();
 }
コード例 #14
0
ファイル: UninstallCommand.cs プロジェクト: noahfalk/dnx
 public UninstallCommand(IAppCommandsRepository commandsRepo, Reports reports)
 {
     _commandsRepo = commandsRepo;
     _reports = reports;
 }
コード例 #15
0
ファイル: ListFeedsCommand.cs プロジェクト: noahfalk/dnx
 public ListFeedsCommand(Reports reports, string targetDirectory)
 {
     Reports = reports;
     TargetDirectory = targetDirectory;
 }