NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 249 forks source link

[Feature]: Add msbuild extension point to better support auto-versioning helpers #11617

Open xoofx opened 2 years ago

xoofx commented 2 years ago

NuGet Product(s) Involved

MSBuild.exe

The Elevator Pitch

Allow NuGet to provide a msbuild public extension point for calculating proper package id/version that would allow auto-versioning helpers to better integrate with NuGet (e.g MinVer).

Additional Context and Details

The problem is that today, most if not all auto-versioning helpers are unable to insert correctly into NuGet msbuild dependencies. See this issue https://github.com/adamralph/minver/issues/675 for more details.

Proposal is to add a public target e.g NuGetPrepareForPackageIdAndVersion that would allow auto-versioning helpers to insert correctly into NuGet, just before _GetOutputItemsFromPack where we are actually requiring the PackageId / PackageVersion to be computed.


  <Target Name=NuGetPrepareForPackageIdAndVersion"/>

  <Target Name="_GetOutputItemsFromPack"
          DependsOnTargets="_GetAbsoluteOutputPathsForPack;NuGetPrepareForPackageIdAndVersion"
          Returns="@(_OutputPackItems)">
nkolev92 commented 2 years ago

_GetProjectVersion is an equivalent target today