Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/MSBuild/XMake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2516,6 +2516,11 @@ private static bool ProcessCommandLineSwitches(
#endif

bool useTerminalLogger = ProcessTerminalLoggerConfiguration(commandLineSwitches, out string aggregatedTerminalLoggerParameters);

// This is temporary until we can remove the need for the environment variable.
// DO NOT use this environment variable for any new features as it will be removed without further notice.
Environment.SetEnvironmentVariable("_MSBUILDTLENABLED", useTerminalLogger ? "1" : "0");

DisplayVersionMessageIfNeeded(recursing, useTerminalLogger, commandLineSwitches);

// Idle priority would prevent the build from proceeding as the user does normal actions.
Expand Down
5 changes: 5 additions & 0 deletions src/UnitTests.Shared/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ void AssertDictionaryInclusion(IDictionary superset, IDictionary subset, string
{
foreach (var key in subset.Keys)
{
if (key is "_MSBUILDTLENABLED")
{
continue;
}

// workaround for https://github.com/dotnet/msbuild/pull/3866
// if the initial environment had empty keys, then MSBuild will accidentally remove them via Environment.SetEnvironmentVariable
if (operation != "removed" || !string.IsNullOrEmpty((string)subset[key]))
Expand Down