Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] File Caching #348

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Incrementalist.Cmd/Commands/EmitDependencyGraphTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.MSBuild;
using Microsoft.Extensions.Logging;
using System.Diagnostics;

namespace Incrementalist.Cmd.Commands
{
Expand Down Expand Up @@ -46,15 +47,19 @@ public async Task<BuildAnalysisResult> Run()
_cts.CancelAfter(Settings.TimeoutDuration);

Logger.LogInformation("Opening solution {Solution}...", Settings.SolutionFile);
var solutionLoadStopwatch = Stopwatch.StartNew();
var solution = await Workspace.OpenSolutionAsync(Settings.SolutionFile, null, _cts.Token);
Logger.LogInformation("Solution opened successfully. Gathering solution files...");
solutionLoadStopwatch.Stop();
Logger.LogInformation("Solution opened in {ElapsedMs}ms. Gathering solution files...", solutionLoadStopwatch.ElapsedMilliseconds);

var getFilesCmd = new GatherAllFilesInSolutionCmd(Logger, _cts.Token, Settings.WorkingDirectory);
var filterFilesCmd = new FilterAffectedProjectFilesCmd(Logger, _cts.Token, Settings.WorkingDirectory, Settings.TargetBranch);

// Get all files and filter affected ones
var fileGatheringStopwatch = Stopwatch.StartNew();
var allFiles = await getFilesCmd.Process(Task.FromResult(solution));
Logger.LogInformation("Found {Count} files in solution", allFiles.Count);
fileGatheringStopwatch.Stop();
Logger.LogInformation("Found {Count} files in solution in {ElapsedMs}ms", allFiles.Count, fileGatheringStopwatch.ElapsedMilliseconds);

Logger.LogInformation("Analyzing Git changes...");
var affectedFiles = await filterFilesCmd.Process(Task.FromResult(allFiles));
Expand Down