public async Task FSharpProjectDiff_should_be_tracked() { var sample = ProjectSampleGenerator.GetFSharpSolutionSample("FSharpSolution.sln"); var solutionFullPath = sample.SolutionFile.GetFullPath(Repository.BasePath); var fsharpProjectFullPath = sample.FSharpProjectFile.GetFullPath(Repository.BasePath); var csharpProjectFullPath = sample.CSharpProjectFile.GetFullPath(Repository.BasePath); Repository .WriteFile(sample.SolutionFile) .WriteFile(sample.CSharpProjectFile) .WriteFile(sample.FSharpProjectFile) .Commit("Created new solution with fsharp and csharp projects") .CreateBranch("foo") .CheckoutBranch("foo") .WriteFile(sample.CSharpProjectFile.Name, sample.CSharpProjectFile.Content + " ") .WriteFile(sample.FSharpProjectFile.Name, sample.FSharpProjectFile.Content + " ") .Commit("Updated both project files"); var logger = new TestOutputLogger(_outputHelper); var settings = new BuildSettings("master", solutionFullPath, Repository.BasePath); var workspace = SetupMsBuildWorkspace(); var emitTask = new EmitDependencyGraphTask(settings, workspace, logger); var affectedFiles = (await emitTask.Run()).ToList(); affectedFiles.Select(f => f.Key).Should().HaveCount(2).And.Subject.Should().BeEquivalentTo(fsharpProjectFullPath, csharpProjectFullPath); }
private static async Task ProcessSln(SlnOptions options, string sln, DirectoryInfo workingFolder, MSBuildWorkspace msBuild, ILogger logger) { var settings = new BuildSettings(options.GitBranch, sln, workingFolder.FullName); var emitTask = new EmitDependencyGraphTask(settings, msBuild, logger); var affectedFiles = (await emitTask.Run()).ToList(); var affectedFilesStr = string.Join(Environment.NewLine, affectedFiles.Select(x => string.Join(",", x.Value))); HandleAffectedFiles(options, affectedFilesStr, affectedFiles.Count); }