NuGet.PackageSourceMapper 0.1.1-dev

This is a prerelease version of NuGet.PackageSourceMapper.
dotnet tool install --global NuGet.PackageSourceMapper --version 0.1.1-dev                
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 NuGet.PackageSourceMapper --version 0.1.1-dev                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NuGet.PackageSourceMapper&version=0.1.1-dev&prerelease                
nuke :add-package NuGet.PackageSourceMapper --version 0.1.1-dev                

NuGet Package Source Mapper tool

Description

This tool helps onboarding to package source mapping feature. It can generate package source mapping section for you from nuget.config file and restored global packages folder. Here is steps to use the tool. It works for both packagereference and packages.config type projects. Please note tool doesn't map packages in fallback folder since they don't get copied to global packages folder.

  1. Declare a new global packages folder for your solution in nuget.config file.
<config>
  <add key="globalPackagesFolder" value="globalPackages" />
</config>
  1. Preparation

    • Do solution restore
    • If you have any restore/build script then please run before running this tool. It applies to any test or any other sub solutions. If you happen to have packages restored in different folder due to sub project settings then please copy them to above global packages folder.
  2. Run this tool with options suitable for you. See examples below.

  3. Copy generated nugetPackageSourceMapping.config file content into your nuget.config file. Please make any adjustments most sutiable for your use case.

  4. Clear all local cache one more time to start on clean slate dotnet nuget locals all --clear

  5. Repeat restore step above and make sure everything still works.

Synopsis:

packagesourcemapper generate <CONFIGPATH> [-h|--help] [--verbosity <LEVEL>] [--id-pattern-only]

Commands

If no command is specified, the command will default to help.

generate

Generates packageSourceMapping section for nuget.config file.

Arguments:

CONFIGPATH

Specify path to nuget.config used for packagesourcemapper. This is positional argument so just value after generate command.

Options:

-h|--help

Show help information

--verbosity <LEVEL>

Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. The default is minimal. For more information, see LoggerVerbosity.

--id-pattern-only

Specify this option to generate full specified pattern instead without prefix. Currently only packages starting with Microsoft, System, Runtime, Xunit are prefixed by default.

Examples

Generate packageSourceMapping section:

PackageSourceMapper.exe generate C:\NuGetProj\NuGet.Client\NuGet.Config

PackageSourceMapper.exe generate C:\NuGetProj\NuGet.Client\NuGet.Config --verbosity diag

Generate packageSourceMapping section without any prefixing:

PackageSourceMapper.exe generate C:\NuGetProj\NuGet.Client\NuGet.Config --verbosity m --id-pattern-only

Feedback

File NuGet.Client bugs in the NuGet/PackageSourceMapper

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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
0.1.1-dev 2 4/5/2022
0.1.0-dev 0 4/5/2022