Webreaper / CentralisedPackageConverter

Converts a project to use Centralised Package Management
Apache License 2.0
344 stars 34 forks source link

CentralisedPackageConverter

Converts a project to use Centralised Package Management

What does it do?

To convert a large project to centralised package management, you need to:

This can be laborious for large projects, hence this tool.

Centralised Package Converter supports both C# and F# projects.

How do I get it?

You can install the tool by running:

dotnet tool install CentralisedPackageConverter --global

Then just run the tool:

central-pkg-converter /Users/markotway/SomeAwesomeProject

How Does it Work?

Run the command, passing a folder as the only parameter. The tool will scan for all .NET project files within that folder tree, gather up a list of all of the versioned references in the projects, and will then remove the versions from the project file, and write the entries to the Directory.Packages.props file.

Command-line Options

Comments

Central Package Management CPM does not support floating versions, such as wildcards or range operators.

Omitted digits will be implicitly added: "8" == "8.0" == "8.0.0".

Incomplete or invalid packages file

The Directory.Packages.props file may be invalid or incomplete:

In these cases, manual edits or version selection will be necessary.

Credits

Thanks to Thomas Ardal for the suggestion and pointers to get this pushed as a dotnet global command. And thanks to all of the other contributors who have helped make this tool even better.