-
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.
Adding accepted SDK name match pattern to SDK manifests. (#7597)
* Add NamePattern field to sdk resolver manifest. * Add changewave 17.3 and move the new sdk-resolving algorithm under it. * Refactor resolver finding. * Add new resolving algo. * Fix tests. * Fix resolver algo. * Address comments. * Add comments. * Add spec for the new sdk resolvers algo. * Add PR link to changewaves wiki; adjust a unit test. * Address comments. * Update src/Build/BackEnd/Components/SdkResolution/SdkResolverLoader.cs Co-authored-by: Rainer Sigwald <[email protected]> * Fix MSBuildToolsDirectoryRoot when BuildEnvironmentMode is None. * Prefer manifest file over assembly. * Address some feedback - 1. * Address some feedback - 2. * Update event-source.md * Update my exceptions. * address comments Co-authored-by: Rainer Sigwald <[email protected]>
- Loading branch information
1 parent
5c5e583
commit b8d947f
Showing
10 changed files
with
656 additions
and
57 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,28 @@ | ||
## SDK Resolution Algorithm | ||
In 17.3 under ChangeWave 17.4 the sdk resolution algorithm is changed. | ||
|
||
### Reason for change | ||
Previously (before ChangeWave 17.4) all SDK resolvers were loaded and then ordered by priority. The resolvers are tried one after one until one of them succeeds. In order to decrease the number of assemblies to be load we change the behavior in 17.3 under ChangeWave 17.4. | ||
|
||
### New SDK Resolution Algorithm | ||
Under ChangeWave 17.4 all the resolvers divides into two groups: | ||
- Specific resolvers, i.e. resolvers with specified sdk name pattern `ResolvableSdkPattern` | ||
- General resolvers, i.e. resolvers without specified sdk name pattern `ResolvableSdkPattern` | ||
|
||
The resolving algorithm works in two passes. | ||
- On the first pass all the specific resolvers that match the given sdk name would be loaded, ordered by priority and tried one after one. | ||
- If the sdk is not found, on the second pass all general resolvers would be loaded, ordered by priority and tried one after one. | ||
|
||
By default the resolvers are general. To make all the resolvers from some dll specific, in the corresponding manifest (xml file) one need to specify the `ResolvableSdkPattern` using C# regex format: | ||
``` | ||
<SdkResolver> | ||
<Path>MySdkResolver.dll</Path> | ||
<ResolvableSdkPattern>MySdk.*</ResolvableSdkPattern> | ||
</SdkResolver> | ||
``` | ||
|
||
Note, that the manifest file, if exists, from ChangeWave 17.4 would have preference over the dll. | ||
The sdk discovery works according to the following algorithm: | ||
- First try locate the manifest file and use it. | ||
- If it is not found, we try to locate the dll in the resolver's folder. | ||
Both xml and dll name should match the following name pattern `...\SdkResolvers\(ResolverName)\(ResolverName).(xml/dll)`. |
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.