-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Implements support for Repo‑Local MSBuild SDKs via .msbuild/Sdk/<SdkName>/ #13027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements support for repository-local MSBuild SDKs by adding a new RepoLocalSdkResolver that searches for SDKs in a .msbuild/Sdk/<SdkName>/ directory within the repository root. This allows projects to use custom SDKs located within their repository without requiring global installation.
Changes:
- Added
RepoLocalSdkResolverclass that walks up the directory tree to find repository markers (.git, .hg, .svn) and searches for SDKs in.msbuild/Sdk/directory - Registered the new resolver in
SdkResolverLoaderwith higher priority (5000) thanDefaultSdkResolver(10000) to allow repo-local SDKs to override global ones - Added comprehensive unit tests covering various scenarios including success cases, failure cases, and edge cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Build/Microsoft.Build.csproj | Adds the new RepoLocalSdkResolver.cs file to the build |
| src/Build/BackEnd/Components/SdkResolution/SdkResolverLoader.cs | Updates both GetDefaultResolvers() and LoadAllResolvers() to include the new RepoLocalSdkResolver before DefaultSdkResolver |
| src/Build/BackEnd/Components/SdkResolution/RepoLocalSdkResolver.cs | New resolver implementation that finds repository root and searches for SDKs in .msbuild/Sdk/ directory |
| src/Build.UnitTests/BackEnd/RepoLocalSdkResolver_Tests.cs | Comprehensive test suite covering all major scenarios for the new resolver |
src/Build/BackEnd/Components/SdkResolution/RepoLocalSdkResolver.cs
Outdated
Show resolved
Hide resolved
src/Build/BackEnd/Components/SdkResolution/RepoLocalSdkResolver.cs
Outdated
Show resolved
Hide resolved
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
This reverts commit bdc8f28.
Fixes #13017
Context
Implements local repo Sdk resolution
Changes Made
Add new local Sdk resolver
Testing
Add new unit tests
Notes