Convert your .NET dependencies to the Directory.Packages.props format

Overview

directory-packages-props-converter

Converts your projects to use Central Package Management. <PackageReference> dependencies have their Version removed in each individual .csproj file. Instead, a Directory.Packages.props file is created in the root folder which contains the version for each separate dependency.

Getting started

Download the binary from the releases.

Mac:

chmod +x ./directory-packages-props-converter
./directory-packages-props-converter .

If your Mac prevents you from running the executable, right-click the executable and select "Open" to override the default block.


Windows:

.\directory-packages-props-converter.exe .

Once you've ran the script, you'll see a new Directory.Packages.props like this:

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup>

    <PackageVersion Include="MSTest.TestAdapter" Version="3.0.2" />
    <PackageVersion Include="MSTest.TestFramework" Version="3.0.2" />
    <PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
    <PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageVersion Include="Microsoft.CodeAnalysis" Version="4.4.0" />
  
  </ItemGroup>
</Project>

and corresponding .csproj changes like this

<ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
-    <PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" />
+    <PackageReference Include="MSTest.TestAdapter" />
</ItemGroup>

Notes

  • When multiple versions are detected for a particular dependency, the highest version number is used
  • Supports .csproj and Directory.Build.props files
  • Partial support for version ranges like [1.1.0, 2]: they will be included in Directory.Packages.props but without trying to discover the largest version
You might also like...
This utility traverses through your filesystem looking for open-source dependencies that are seeking donations by parsing README.md and FUNDING.yml files
This utility traverses through your filesystem looking for open-source dependencies that are seeking donations by parsing README.md and FUNDING.yml files

This utility traverses through your filesystem looking for open-source dependencies that are seeking donations by parsing README.md and FUNDING.yml files

Search PyPI for packages from the command line.
Search PyPI for packages from the command line.

PPS -- Python Package Index Search Search the PyPI for packages by name, which was done by pip search in the past. This was heavily inspired by pip_se

A Rust CLI to provide last publish dates for packages in a package-lock.json file

NPM Package Age A Rust CLI which if you provide a npm lockfile (package-lock.json to start), it will give you a listing of all of the packages & the l

Interface definition generator and standard for Move packages.

Move IDL Interface definition generator and standard for Move packages. Documentation is currently extremely sparse but will be improved in the near f

Readme generator for Move packages.

Move Readme Readme generator for Move packages. Documentation is currently extremely sparse but will be improved in the near future. Setup Install the

A simple gtk4/libadwaita software center to easily install and manage nix packages
A simple gtk4/libadwaita software center to easily install and manage nix packages

Nix Software Center A graphical app store for Nix built with libadwaita, GTK4, and Relm4. Heavily inspired by GNOME Software. Features Install package

Generate Nix packages from URLs
Generate Nix packages from URLs

Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more

Fast KubeJS script manager. Includes version control and compatibility with KJSPKG packages.
Fast KubeJS script manager. Includes version control and compatibility with KJSPKG packages.

CarbonJS A KubeJS script manager Features 🔥 Super fast ⚙️ Version control 📁 Constantly new scripts being added ✅ Easy to use 🧱 Compatibility with K

Packages for Typst.

Typst Packages An experimental package repository for Typst. A searchable list of all packages that were submitted here is available in the official d

Comments
  • [Feature] Publish dotnet tool

    [Feature] Publish dotnet tool

    Hello!

    It'd be really neat if we could install this globally as a dotnet tool! https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools

    Then it could be installed once and used in any project instead of either 1) modifying your PATH, 2) copy/pasting this everywhere you need it, or 3) keeping it only in my download directory.

    opened by celluj34 0
Releases(v0.1.0)
Owner
Jeroen Vannevel
Jeroen Vannevel
Manage your dotfiles and packages with ease. Define your $HOME as Code 💻 🚀 ✨

EnvHub is a simple tool to manage dotfiles and packages accross multiple machines. Written in Rust, internally it uses nix/homebrew/pkgx/devbox to man

Tsiry Sandratraina 8 Oct 27, 2023
Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and at compile-time.

rgb2ansi256 rgb2ansi256 is a small Rust library to convert RGB 24-bit colors into ANSI 256 (8-bit) color codes with zero dependencies and const fn. Th

Linda_pp 7 Nov 17, 2022
Check the reproducibility status of your Arch Linux packages (read-only mirror)

arch-repro-status A CLI tool for querying the reproducibility status of the Arch Linux packages using data from a rebuilderd instance such as reproduc

Arch Linux 12 Nov 16, 2022
.NET PhysX 5 binding to all platforms(win, osx, linux) for 3D engine, deep learning, dedicated server of gaming.

MagicPhysX .NET PhysX 5 binding to all platforms(win-x64, osx-x64, osx-arm64, linux-x64, linux-arm64) for 3D engine, deep learning, dedicated server o

Cysharp, Inc. 37 Jul 4, 2023
A cli utility for playing music mixes for programming & focus from musicforprogramming.net

mfp: music for programming A command-line utility for playing music mixes for programming & focus (from musicforprogramming.net), unlocking the flow s

Rohit Gupta 10 Jul 12, 2023
This rust compiler backend emmits valid CLR IR, enambling you to use Rust in .NET projects

What is rustc_codegen_clr? NOTE: this project is a very early proof-of-concept This is a compiler backend for rustc which targets the .NET platform an

null 252 Sep 7, 2023
⚡️(cd with env) Is a configurable cd wrapper that lets you define your environment per directory.

⚡️cdwe (cd with env) A simple configurable cd wrapper that provides powerful utilities for customizing your envionment per directory. (For ZSH / BASH

teo 20 Aug 6, 2023
Convert your favorite images and wallpapers with your favorite color palettes/themes

dipc doprz' image palette converter Convert your favorite images and wallpapers with your favorite color palettes/themes Color Palettes/Themes catppuc

null 50 Apr 26, 2023
Tight Model format is a lossy 3D model format focused on reducing file size as much as posible without decreasing visual quality of the viewed model or read speeds.

What is Tight Model Format The main goal of the tmf project is to provide a way to save 3D game assets compressed in such a way, that there are no not

null 59 Mar 6, 2023
Given a set of kmers (fasta format) and a set of sequences (fasta format), this tool will extract the sequences containing the kmers.

Kmer2sequences Description Given a set of kmers (fasta / fastq [.gz] format) and a set of sequences (fasta / fastq [.gz] format), this tool will extra

Pierre Peterlongo 22 Sep 16, 2023