-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support folder name "Sdk" or "sdk" in NuGet SDK resolver #2913
Conversation
if (NativeMethodsShared.IsWindows) | ||
{ | ||
// Get the installed path and add the expected "Sdk" folder. Windows file systems are not case sensitive | ||
installedPath = Path.Combine(packageInfo.PathResolver.GetInstallPath(packageInfo.Id, packageInfo.Version), "Sdk"); |
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.
Move this outside the if
and just do if !windows && !exist? seems cleaner to read.
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.
👍 I messed with the logic so much I forgot to go back and simplify. I ❤️ code reviews
@@ -203,8 +203,15 @@ private static bool TryGetMSBuildSdkPackageInfo(FallbackPackagePathResolver fall | |||
return false; | |||
} | |||
|
|||
// Get the installed path and add the expected "Sdk" folder | |||
// Get the installed path and add the expected "Sdk" folder. Windows file systems are not case sensitive |
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.
If sdk
is the expected/documented casing as mentioned in #2803 (comment) I think we should flip the check around?
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.
Approved for 15.6
Since some non-Windows file systems are case sensitive, SDK authors will need to know that the "Sdk" folder is supposed to be capitalized.
This change makes it so that SDK package owners can use "Sdk" or "sdk". See relevant discuss here: #2803 (comment)
There will be a little overhead to check directory existence.