Repository navigation
Conversation
|
|
||
| <PropertyGroup> | ||
| <ImportDirectoryPackagesProps Condition="'$(ImportDirectoryPackagesProps)' == ''">true</ImportDirectoryPackagesProps> | ||
| <PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' != 'false' And '$(ImportDirectoryPackagesProps)' != 'false' And '$(DirectoryPackagesPropsPath)' == ''"> |
There was a problem hiding this comment.
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.
@kartheekp-ms if you have github configured to use "unified" diffs, consider changing to "split":

| <Import Project="$(DirectoryPackagesPropsPath)" Condition="'$(ManagePackageVersionsCentrally)' != 'false' And '$(ImportDirectoryPackagesProps)' != 'false' And Exists('$(DirectoryPackagesPropsPath)')" /> | ||
|
|
||
| <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.
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.propsmeans 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 setManagePackageVersionsCentrallytotrue. The logic now assumes ifDirectory.Packages.propsexists thenManagePackageVersionsCentrallyshould betrueunless 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