Skip to content

Add alternative casings for finding NuGet.config file. #7549

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

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

crummel
Copy link
Contributor

@crummel crummel commented Jun 22, 2021

This allows us to find NuGet.config files that are named NuGet.Config or nuget.config, all of which are supported by NuGet. In particular, nuget.config is actually the recommended casing for new projects on Linux so this may be increasingly common.

I didn't add an error condition when none of these are found because Arcade does not always need to work with NuGet.config, so this defers the error to when it actually causes a problem.

Comment on lines +23 to +25
<RestoreConfigFile Condition="Exists('$(RepoRoot)NuGet.config')">$(RepoRoot)NuGet.config</RestoreConfigFile>
<RestoreConfigFile Condition="Exists('$(RepoRoot)NuGet.Config')">$(RepoRoot)NuGet.Config</RestoreConfigFile>
<RestoreConfigFile Condition="Exists('$(RepoRoot)nuget.config')">$(RepoRoot)nuget.config</RestoreConfigFile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To bad this cant be made to not care about the casing on the file name at all so one that haves the name and extension in all caps can still be able to use it.

If only nuget could also be updated to not care on it's name case as well too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still need this at all since NuGet will automatically pick up the nuget.config in the repo root.

Looking at the history, this was used to make sure NuGet wouldn't pick up a file outside of the repo root (presumably because some repos didn't have one?) but this shouldn't be a supported scenario anymore now that we require using the AzDO feeds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, this is still required for source-build because some of our contributing repos use different filename casings. We are patching to work around this but it would be really nice to actually have it in Arcade.

@crummel
Copy link
Contributor Author

crummel commented Mar 24, 2022

@tmat @akoeplinger Could we try to get this in? It's come up again as the Homebrew folks are trying to bring up source-build on OSX and that uses a case-insensitive filesystem so our patch to "correct" the filename fails.

@akoeplinger akoeplinger merged commit 909c207 into dotnet:main Mar 24, 2022
@crummel
Copy link
Contributor Author

crummel commented Mar 24, 2022

Thanks!

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.

3 participants