-
Notifications
You must be signed in to change notification settings - Fork 89
Description
The Problem
The general steps to create a NuGet package that contains MSBuild tasks is outlined here: https://learn.microsoft.com/en-us/visualstudio/msbuild/tutorial-custom-task-code-generation?view=vs-2022#package-the-task-for-distribution
This process requires 8 steps:
- Set
CopyLocalLockFileAssemblies
- Mark all PackageReferences with
PrivateAssets="All"
- Add the
CopyProjectReferencesToPackage
target - Set the
BuildOutputTargetFolder
- Suppress NU5100 and NU5128
- Mark Microsoft.Build.* assemblies with
ExcludeAssets="runtime"
- Set
GenerateDependencyFile
and add target to copy to output directory - Add the build/, buildTransitive/, buildMultiTargeting/ folders to the package
and I always forget at least one when creating a new project.
The Proposal
Create a new SDK to centralize these steps, and ideally update the docs to point to the SDK instead. In addition to lowering the barrier to authoring MSBuild tasks, centralizing the process for creating an MSBuild task package will make it easier for authors to follow best practices as they evolve (similar to the DotNet.ReproducibleBuilds packages).
I'm happy to do this work myself, but wanted to get approval before starting. Thoughts?