Skip to content

Use central package management #2045

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

Conversation

Kryptos-FR
Copy link
Member

@Kryptos-FR Kryptos-FR commented Nov 17, 2023

PR Details

https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management

Description

Adds Directory.Packages.props and references all package versions there.

Related Issue

Discussed on Discord.

Motivation and Context

Prevent out-of-sync dependencies between projects.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Kryptos-FR Kryptos-FR changed the title Use central package mangement Use central package management Nov 17, 2023
@Kryptos-FR Kryptos-FR marked this pull request as ready for review November 17, 2023 12:00
@@ -223,7 +223,7 @@

<!-- SourceLink -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Condition="'$(StrideProjectType)' == 'CSharp'" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Condition="'$(StrideProjectType)' == 'CSharp'" VersionOverride="1.0.0" PrivateAssets="All"/>
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: this is a bit hackish but necessary because the Directory.Packages.props gets imported later, and the build complains if we try to use Version nonetheless.

@Kryptos-FR Kryptos-FR mentioned this pull request Nov 17, 2023
8 tasks
@Eideren Eideren requested a review from xen2 November 17, 2023 17:48
@Kryptos-FR Kryptos-FR force-pushed the feature/central-package-management branch from 2b99765 to 6e0ceec Compare November 17, 2023 20:29
@Kryptos-FR Kryptos-FR force-pushed the feature/central-package-management branch from 6e0ceec to 42a23cc Compare November 17, 2023 20:30
Copy link
Member

@xen2 xen2 left a comment

Choose a reason for hiding this comment

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

LGTM!
I ran it and double-check the nuget resolver result (on GameStudio only) to check if no package unintentionally changed/added/removed: it was all good.
Great change, thanks again.

# Conflicts:
#	sources/engine/Stride.Input/Stride.Input.csproj
@Kryptos-FR
Copy link
Member Author

Thanks for the review @xen2. I have resolved the conflict from latest master.

Note: some versions used here are more recent than in other projects, so an override was set.
@xen2
Copy link
Member

xen2 commented Dec 28, 2023

Noticed a small issue when building package:
https://teamcity.stride3d.net/buildConfiguration/Package_BuildPackage/23697?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildDeploymentsSection=true&expandBuildChangesSection=true&expandBuildProblemsSection=true&guest=1

deps\Stride.GitVersioning\Stride.GitVersioning.csproj : error NU1008: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: Microsoft.Build.Utilities.Core;LibGit2Sharp.

@Kryptos-FR
Copy link
Member Author

Should be fixed by the other PR that moved the props file #2055 to avoid conflicts with deps.

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