NuGetRepackager 0.0.0-pr.1.0.0

This is a prerelease version of NuGetRepackager.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global NuGetRepackager --version 0.0.0-pr.1.0.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local NuGetRepackager --version 0.0.0-pr.1.0.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NuGetRepackager&version=0.0.0-pr.1.0.0&prerelease                
nuke :add-package NuGetRepackager --version 0.0.0-pr.1.0.0                

NuGet Repackager

NuGet Repackager is a .NET tool for repackaging pre-release NuGet packages into an automatically calculated release version, or into a specified pre-release or release version. This tool also provides options for updating associated files to reflect the occurrence of the repackaging.

Developers can focus their attention towards managing the semantic versioning of the pre-release version tag instead of the standard release version and can leverage this tool when a pre-release package is chosen for a standard release. Once leveraging this tool it's unlikely that a developer would need to manually change the standard release version part of a package version (1.2.3 in 1.2.3-pr.4.5.6). Developers will only need to maintain the additions of and updates to the pre-release version part of a package version (-pr.4.5.6 in 1.2.3-pr.4.5.6).

This tool aims to assist developers with Continuous Integration during NuGet package development, and makes branching strategies like trunk-based or mainline branching easier, as it lends itself towards making small updates and frequently available pre-release packages, and performs automated package version and branch reconciliation to keep developers moving forward.

Install NuGet Repackager As A .NET Tool

Install From NuGet Package Source

  1. Execute the following command into your command-line terminal: dotnet tool install --global NuGetRepackager --version 1.0.0.

    Make sure to enter the version that you'd like to use.

  2. We should now be able to use the tool with the command NuGetRepackager.

Install From Local Project Source

  1. Clone, or download a ZIP of, the repository.

  2. Build and Pack the NuGetRepackager console application.

  3. Navigate to the solution root for the project from your command-line terminal.

  4. Execute the following command: dotnet tool install --global --add-source ./NuGetRepackager/bin/Debug NuGetRepackager.

  5. We should now be able to use the tool with the command NuGetRepackager.

List Of Flags

Flag Flag Name Flag Description
--prv Pre-Release Version The pre-release version that is being targeted for repackaging.
--nupkg NuGet Package File Location The location of the NuGet package being repackaged, including the file name.
--csproj CsProj File Location The location of the associated CsProj file that needs updated with the occurrence of a pre-release package being repackaged as a release, including the file name.
--nuspec NuSpec File Location The location of the NuSpec that needs updated with the occurrence of a pre-release package being repackaged as a release, including the file name.
--forced-v Forced Version The version that a targeted package should be repackaged to.
--forced-nupkg Forced Version NuGet Package File Location The location of the NuGet package being repackaged to a forced version, including the file name.

Repackage NuGet Packages

  1. Open a terminal.

  2. Enter the beginning of the command: NuGetRepackager.

  3. Append the pre-release version with the Pre-Release Version flag (--prv): --prv=11.0.0-pr.1.1.1.

  4. From here on we can add any additional flags that will accomplish what we're looking to do. As an example, let's pretend that we would like to repackage a NuGet package and then update the main branch of the repository that the package came from.

    The entire command should look like this: NuGetRepackager --prv=11.0.0-pr.1.1.1 --csproj={CsProjFilePath}.

  5. Execute the command.

Tips For Repackaging NuGet Packages

Using the --nupkg flag with the --nuspec flag.

Unless you're targeting a specific NuSpec file that is outside of the primary NuGet package being repackaged there is no need to use the --nuspec flag in conjuction with the --nupkg flag. The NuSpec file inside of the targeted NuGet package will be included as part of the repackaging for the entire NuGet package specified with the --nupkg flag.

Updating A CsProj File

One of the perks of this tool is that it assists with Continuous Integration and branching strategies like trunk-based or mainline branching.
When a pre-release NuGet package is repackaged we are likely going to need to merge that occurrence into the main branch for the package. The --csproj flag allows us to specify the CsProj file which needs its package release notes history and version reconciled.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.0-pr.1.1.0 105 7/1/2023
0.0.0-pr.1.0.0 70 5/15/2023

0.0.0-pr.1.0.0 Created the initial NuGetRepackager tool.