Пример #1
0
    static async Task ProcessSolution(string solution, string?package)
    {
        if (Excluder.ShouldExclude(solution))
        {
            Console.WriteLine($"  Exclude: {solution}");
            return;
        }

        Console.WriteLine($"  {solution}");
        await SolutionRestore.Run(solution);

        var solutionDirectory = Directory.GetParent(solution) !.FullName;

        foreach (var project in FileSystem.EnumerateFiles(solutionDirectory, "*.csproj"))
        {
            Console.WriteLine($"    {project.Replace(solutionDirectory, "").Trim(Path.DirectorySeparatorChar)}");
            foreach (var pending in await PendingUpdateReader.ReadPendingUpdates(project))
            {
                if (package == null)
                {
                    await Update(project, pending.Package, pending.Latest);

                    continue;
                }

                if (string.Equals(package, pending.Package, StringComparison.OrdinalIgnoreCase))
                {
                    await Update(project, pending.Package, pending.Latest);
                }
            }
        }
    }
Пример #2
0
    public Task ThisSolution()
    {
        var file = Path.Combine(GitRepoDirectoryFinder.Find(), "src", "PackageUpdate.sln");

        return(SolutionRestore.Run(file));
    }