Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Oct 21, 2023
1 parent a6a0538 commit 85521c6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ public void StartBatchBuild(IDictionary<string, string>? globalProperties = null
Verbosity = MSB.Framework.LoggerVerbosity.Normal
};

// Pass in the binlog (if any) to the ProjectCollection to ensure evaluation results are included in it.
//
// We do not need to include the _batchBuildLogger in the ProjectCollection - it just collects the
// DiagnosticLog from the build steps, but evaluation already separately reports the DiagnosticLog.
var loggers = _msbuildLogger is not null
? ImmutableArray.Create(_msbuildLogger)
: ImmutableArray<MSB.Framework.ILogger>.Empty;
Expand All @@ -175,6 +179,8 @@ public void StartBatchBuild(IDictionary<string, string>? globalProperties = null

var buildParameters = new MSB.Execution.BuildParameters(_batchBuildProjectCollection)
{
// The loggers are not inherited from the project collection, so specify both the
// binlog logger and the _batchBuildLogger for the build steps.
Loggers = loggers.Add(_batchBuildLogger),
// If we have an additional logger and it's diagnostic, then we need to opt into task inputs globally, or otherwise
// it won't get any log events. This logic matches https://github.com/dotnet/msbuild/blob/fa6710d2720dcf1230a732a8858ffe71bcdbe110/src/Build/Instance/ProjectInstance.cs#L2365-L2371
Expand Down

0 comments on commit 85521c6

Please sign in to comment.