Skip to content
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

Merged
merged 2 commits into from
Feb 1, 2018

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Jan 25, 2018

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.

@jeffkl jeffkl requested a review from nguerrera January 25, 2018 23:29
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");
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor

@AndyGerlicher AndyGerlicher left a 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

@AndyGerlicher AndyGerlicher merged commit b3675db into dotnet:vs15.6 Feb 1, 2018
@jeffkl jeffkl deleted the case-sdk-1 branch October 9, 2019 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants