Exemplo n.º 1
0
    private async Task Run()
    {
        Program.DisplayProductInfo();

        Colorful.Console.WriteLine();
        Colorful.Console.WriteLine("Working. Please wait...", Color.GreenYellow);

        var slnFileReader = new SolutionFileReader(SolutionFileName, ProjectsOnly);
        var solution      = slnFileReader.Read();

        var flatList = solution.ExtractNugetPackageAsFlatList();
        var categorizedByPackageNameList = solution.CategorizeByPackageName(flatList);

        var packageNames = new List <string>();

        foreach (var item in categorizedByPackageNameList)
        {
            packageNames.Add(item.Key);
        }

        var latestPackages = await QueryNugetPackageOnlineAsync(packageNames.ToArray(), CliStringFormatter.WriteOnlinePackageProgressHandler);

        Colorful.Console.WriteLine();

        categorizedByPackageNameList = categorizedByPackageNameList.OrderBy(x => x.Key).ToDictionary();

        WriteOutput(categorizedByPackageNameList, solution.SolutionFileName, solution.Projects.Count(), latestPackages);
    }
Exemplo n.º 2
0
    private async Task Run()
    {
        Program.DisplayProductInfo();

        Colorful.Console.WriteLine();
        Colorful.Console.WriteLine("Working. Please wait...", Color.GreenYellow);

        var slnFileReader = new SolutionFileReader(SolutionFileName, true);
        var solution      = slnFileReader.Read();

        var flatList = solution.ExtractNugetPackageAsFlatList();
        var categorizedByPackageNameList = solution.CategorizeByPackageName(flatList);

        Colorful.Console.WriteLine();

        if (categorizedByPackageNameList.ContainsKey(NugetPackage))
        {
            var projects = categorizedByPackageNameList[NugetPackage];

            if (_returnResults)
            {
                Results = projects;
            }
            else
            {
                WriteOutput(projects, solution.SolutionFileName);
            }

            return;
        }

        Colorful.Console.WriteLine($"'{NugetPackage}' nuget package is not referenced in any project.\n");

        await Task.Delay(1);
    }
    private Solution ReadSolutionStructure()
    {
        var slnFileReader = new SolutionFileReader(SolutionFileName, true);

        try
        {
            var solution = slnFileReader.Read();
            return(solution);
        }
        catch (SolutionFileException)
        {
            throw;
        }
        catch (Exception)
        {
            throw;
        }
    }
Exemplo n.º 4
0
    private async Task Run()
    {
        Program.DisplayProductInfo();

        var      slnFileReader = new SolutionFileReader(SolutionFileName, ProjectsOnly);
        Solution solution      = null;

        #region Solution file reader execution section
        try
        {
            solution = slnFileReader.Read();

            Colorful.Console.WriteLine();
            Colorful.Console.Write($"{CliStringFormatter.Format15}", "Solution ");
            Colorful.Console.WriteLine($": {solution.SolutionFileName}", Color.PapayaWhip);
            Colorful.Console.Write("Total Projects : ");
            Colorful.Console.WriteLine($"{solution.Projects.Count()}\n", Color.PapayaWhip);

            Colorful.Console.WriteLine();
            Colorful.Console.WriteLine("Working. Please wait...", Color.DeepSkyBlue);
        }
        catch (SolutionFileException)
        {
            throw;
        }
        catch (Exception)
        {
            throw;
        }
        #endregion

        NugetPackageOnlineComparer comparer = null;
        if (ShowNugetPackageUpdates)
        {
            comparer = new NugetPackageOnlineComparer(solution, ShowPreReleaseNugetPackages, CliStringFormatter.WriteOnlinePackageProgressHandler);
            await comparer.Run();
        }

        Colorful.Console.WriteLine();

        WriteFinalizedResultToScreen(solution, comparer?.Result);
    }
    private Task Run()
    {
        Program.DisplayProductInfo();

        var      slnFileReader = new SolutionFileReader(SolutionFileName, true);
        Solution solution;

        #region Solution file reader execution section
        try
        {
            solution = slnFileReader.Read();

            Colorful.Console.WriteLine();
            Colorful.Console.Write($"{CliStringFormatter.Format15}", "Solution ");
            Colorful.Console.WriteLine($": {solution.SolutionFileName}", Color.PapayaWhip);
            Colorful.Console.Write("Total Projects : ");
            Colorful.Console.WriteLine($"{solution.Projects.Count()}\n", Color.PapayaWhip);

            Colorful.Console.WriteLine();
            Colorful.Console.WriteLine("Working. Please wait...", Color.DeepSkyBlue);
        }
        catch (SolutionFileException)
        {
            throw;
        }
        catch (Exception)
        {
            throw;
        }
        #endregion

        Colorful.Console.WriteLine();

        WriteFinalizedResultToScreen(solution);

        return(Task.CompletedTask);
    }