-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve SDKs using an ISdkResolverService (#2847)
A singleton instance handles all resolution. A service hosted in the main node handles build related evaluation on the main node and a service hosted in the out-of-proc node sends requests to the main node for processing. A cache exists on the main node so that requests are only resolved once per build. The out-of-proc node also caches responses so that an SDK is only resolved once. Non-build evaluations are not cached and could be slow since there is no way to know if two evaluations are related. Address the first step in #2803 * Log a warning if different versions of the same SDK are specified * Log a warning if the SDK version specified does not match what was resolved * Improve Microsoft.Build.UnitTests.Preprocessor.Preprocessor_Tests.SdkImportsAreInPreprocessedOutput by using TestEnvironment to mock SDK resolution * Add escape hatch to disable caching the result on the main node `MSBUILDDISABLESDKCACHE`
- Loading branch information
Showing
40 changed files
with
1,365 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.Build.BackEnd; | ||
using Microsoft.Build.BackEnd.Logging; | ||
using Microsoft.Build.BackEnd.SdkResolution; | ||
using Microsoft.Build.Construction; | ||
using Microsoft.Build.Framework; | ||
using System; | ||
|
||
namespace Microsoft.Build.Engine.UnitTests.BackEnd | ||
{ | ||
internal class MockSdkResolverService : IBuildComponent, ISdkResolverService | ||
{ | ||
public Action<INodePacket> SendPacket { get; } | ||
|
||
public void ClearCache(int submissionId) | ||
{ | ||
} | ||
|
||
public string ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath) | ||
{ | ||
return null; | ||
} | ||
|
||
public void InitializeComponent(IBuildComponentHost host) | ||
{ | ||
} | ||
|
||
public void ShutdownComponent() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.