-
Notifications
You must be signed in to change notification settings - Fork 695
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
Enable central package management implicitly when Directory.Packages.props exists #5540
Conversation
|
||
<PropertyGroup> | ||
<ImportDirectoryPackagesProps Condition="'$(ImportDirectoryPackagesProps)' == ''">true</ImportDirectoryPackagesProps> | ||
<PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' != 'false' And '$(ImportDirectoryPackagesProps)' != 'false' And '$(DirectoryPackagesPropsPath)' == ''"> |
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 found it difficult to understand the XML syntax while reviewing this pull request, so I have pasted the formatted XML here in case it helps to quickly grasp the changes.
<PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' != 'false' And '$(ImportDirectoryPackagesProps)' != 'false' And '$(DirectoryPackagesPropsPath)' == ''">
<_DirectoryPackagesPropsFile Condition="'$(_DirectoryPackagesPropsFile)' == ''">
Directory.Packages.props
</_DirectoryPackagesPropsFile>
<_DirectoryPackagesPropsBasePath Condition="'$(_DirectoryPackagesPropsBasePath)' == ''">
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', '$(_DirectoryPackagesPropsFile)'))
</_DirectoryPackagesPropsBasePath>
<DirectoryPackagesPropsPath Condition="'$(_DirectoryPackagesPropsBasePath)' != '' and '$(_DirectoryPackagesPropsFile)' != ''">
$([MSBuild]::NormalizePath('$(_DirectoryPackagesPropsBasePath)', '$(_DirectoryPackagesPropsFile)'))
</DirectoryPackagesPropsPath>
</PropertyGroup>
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.
@kartheekp-ms if you have github configured to use "unified" diffs, consider changing to "split":
|
||
<PropertyGroup Condition="'$(ImportDirectoryPackagesProps)' == 'true' and '$(DirectoryPackagesPropsPath)' != '' and Exists('$(DirectoryPackagesPropsPath)')"> | ||
<PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' != 'false' And '$(ImportDirectoryPackagesProps)' != 'false' And Exists('$(DirectoryPackagesPropsPath)')"> |
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.
How about just checking <PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' == 'true' >
because ManagePackageVersionsCentrally is only true
only when '$(ImportDirectoryPackagesProps)' != 'false' And Exists('$(DirectoryPackagesPropsPath)')
?
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
Bug
Fixes: NuGet/Home#11834
Regression? Last working version:
Description
This change makes it so the presence of a
Directory.Packages.props
means that central package management is implicitly on. I've had countless people ask over the last year why you have to have the file and explicitly setManagePackageVersionsCentrally
totrue
. The logic now assumes ifDirectory.Packages.props
exists thenManagePackageVersionsCentrally
should betrue
unless the user has already set that property to a value, including if its set inDirectory.Packages.props
. This will make it easier for customers to onboard.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation