Skip to content

Migrate to Centralized NuGet Package Management (CPM)#319

Merged
Tyrrrz merged 3 commits intomasterfrom
copilot/migrate-to-centralized-package-management
Feb 26, 2026
Merged

Migrate to Centralized NuGet Package Management (CPM)#319
Tyrrrz merged 3 commits intomasterfrom
copilot/migrate-to-centralized-package-management

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

  • Create Directory.Packages.props with all package versions centrally managed, sorted alphabetically
  • Update all .csproj files to remove Version attributes from <PackageReference> elements
  • Add Directory.Packages.props to the Misc solution folder in CliWrap.sln
Original prompt

Migrate to Centralized NuGet Package Management (CPM)

Migrate the repository from per-project Version attributes on <PackageReference> to NuGet's Centralized Package Management (CPM).

What to do

  1. Create a Directory.Packages.props file at the root of the repository with <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> and a <PackageVersion> entry for every unique package used across all .csproj files. Use the version already present in the .csproj files.

  2. Update all .csproj files to remove the Version="..." attribute from every <PackageReference> element (CPM now manages the version centrally). Keep all other attributes (e.g. PrivateAssets, Condition, ExcludeAssets, etc.) intact.

  3. Do not change any TargetFramework(s), project structure, or anything unrelated to package versioning.

Reference

See how it was done in the sibling repo Tyrrrz/YoutubeExplode PR #940: Tyrrrz/YoutubeExplode#940

Notes

  • If a package appears with different versions in different projects, use the highest version and make a note in the PR description.
  • <PackageVersion> entries in Directory.Packages.props should be sorted alphabetically.
  • Make sure the file includes a valid MSBuild props file <Project> root element.
  • Preserve all Condition attributes on <PackageReference> elements.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate to Centralized NuGet Package Management (CPM) Migrate to Centralized NuGet Package Management (CPM) Feb 26, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review February 26, 2026 19:02
Copilot AI review requested due to automatic review settings February 26, 2026 19:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the solution to NuGet Central Package Management (CPM) so package versions are defined once at the repo root instead of repeated across individual .csproj files.

Changes:

  • Added Directory.Packages.props enabling CPM and centralizing all package versions.
  • Removed Version="..." attributes from all <PackageReference> items across projects while preserving other attributes/conditions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Directory.Packages.props Introduces centralized <PackageVersion> declarations and enables CPM.
CliWrap/CliWrap.csproj Removes per-reference versions; keeps conditions and PrivateAssets intact.
CliWrap.Tests/CliWrap.Tests.csproj Removes per-reference versions for test dependencies; preserves PrivateAssets.
CliWrap.Tests.Dummy/CliWrap.Tests.Dummy.csproj Removes per-reference versions for dummy test app dependencies.
CliWrap.Signaler/CliWrap.Signaler.csproj Removes per-reference versions for tooling dependencies.
CliWrap.Benchmarks/CliWrap.Benchmarks.csproj Removes per-reference versions for benchmark dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Feb 26, 2026

@copilot add the created Directory.Packages.props file to the sln file

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 26, 2026

@copilot add the created Directory.Packages.props file to the sln file

Done in abc2eeeDirectory.Packages.props has been added to the Misc solution folder in CliWrap.sln, alongside Directory.Build.props.

@Tyrrrz Tyrrrz merged commit 4bb46cd into master Feb 26, 2026
7 checks passed
@Tyrrrz Tyrrrz deleted the copilot/migrate-to-centralized-package-management branch February 26, 2026 19:26
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.48%. Comparing base (526e851) to head (abc2eee).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #319   +/-   ##
=======================================
  Coverage   94.48%   94.48%           
=======================================
  Files          45       45           
  Lines        1215     1215           
  Branches       89       89           
=======================================
  Hits         1148     1148           
  Misses         42       42           
  Partials       25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants