Add global properties to SdkResolverContext#3617
Add global properties to SdkResolverContext#3617jeffkl wants to merge 1 commit intodotnet:vs15.9from
Conversation
This will allow the NuGet SDK resolver to read the global property `NuGetInteractive` so it can prompt the user.
|
Please review ASAP to get this in so I can update NuGet's SDK resolver. |
|
@nguerrera any thoughts or concerns with this? |
|
I'm not a fan of this approach, as I mentioned in #2095 (comment). |
|
I've asked for it a few times, See #2095. |
|
Though restricting to global properties helps, I'm not sure it's enough since you could have global properties set in a p2p reference. |
|
At the end of #2095, I asked if global properties alone would be OK. Seems we have varying answers still. :) |
|
I have no objections and you can close #2095 if you decide to take it. I don't have a pressing need for this either. |
|
|
||
| // Combine SDK path with the "project" relative path | ||
| sdkResult = _sdkResolverService.ResolveSdk(_submissionId, importElement.ParsedSdkReference, _evaluationLoggingContext, importElement.Location, solutionPath, projectPath); | ||
| sdkResult = _sdkResolverService.ResolveSdk(_submissionId, importElement.ParsedSdkReference, _evaluationLoggingContext, importElement.Location, solutionPath, projectPath, _data.GlobalPropertiesDictionary.ToDictionary()); |
There was a problem hiding this comment.
This will allocate, and if there's many global properties it will allocate a lot. But I don't see another way around, save for moving to immutable collections
|
|
||
| /// <inheritdoc cref="ISdkResolverService.ResolveSdk"/> | ||
| public override SdkResult ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath) | ||
| public override SdkResult ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, IDictionary<string, string> globalProperties) |
There was a problem hiding this comment.
Would IReadOnlyDictionary make better sense?
|
Nevermind... |
This will allow the NuGet SDK resolver to read the global property
NuGetInteractiveso it can prompt the user.