dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.16k stars 1.34k forks source link

Expander refactoring [property tracking analyzers prerequisity] #10102

Closed JanKrivanek closed 3 weeks ago

JanKrivanek commented 1 month ago

Contributes to #9883 (spinoff from #10009 - focusing on parts not related to BuildCheck)

Note

There is no new functionality in this PR - just refactoring and code moving. It is required for the followup PR(s) for property tracking analyzers

Context

Expander is using LoggingContext in some of the execution paths, but in it usually has a default value of null - so we end up with literaly hundrets of calling paths where we cannot be sure whether LoggingContext is available or not. The LoggingContext is appealing for a data pub-sub, so let's make sure it's available throughout the Expander calls, while at the same let's simplify the code a bit

Changes Made

Testing

Refactored and resued existing tests (as there is no new functionality)