-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] New MSBuildSdk to simplify creating an MSBuild task package #551
Comments
I'm torn about where the line for an MSBuild SDK and a .NET Template might be - I could see pushing several of those steps into an MSBuild SDK, and then shipping a .NET SDK Template that could get your started on a new Task package - project file using the new SDK, placeholder props/targets, a class library for a Task with all of the organization/project file changes to make it all work, etc. To be clear, I'd love to see something like a base SDK exist! I love this suggestion and would be happy to help push it forward. |
OK, happy to get started here. Two asks:
|
Happy to give input - interested to see how y'all gonna approach this - supporting VS desktop and dotnet cli - supporting testing... If you need some inspiration i'll throw my package in the ring: https://github.com/MeikTranel/NXPorts/blob/master/src/NXPorts/NXPorts.csproj I use MSBuild sdk/task packages much more extensively but unfortunately i cant post these here. |
I wonder if there's a broader generalization to this proposal which might be "Plugin SDK". Similar constraints might apply to roslyn analyzers, MSBuild tasks, powershell commandlets, Azure functions, etc. |
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:
CopyLocalLockFileAssemblies
PrivateAssets="All"
CopyProjectReferencesToPackage
targetBuildOutputTargetFolder
ExcludeAssets="runtime"
GenerateDependencyFile
and add target to copy to output directoryand 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?
The text was updated successfully, but these errors were encountered: