-
Notifications
You must be signed in to change notification settings - Fork 258
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
Producing an MSBuild task package #5063
Comments
From @rohit21agrawal on April 14, 2017 21:27 we already added some extension points that should make this easier : NuGet/NuGet.Client#1255 We can't make a generic Task package type since all packages would differ widely. Do you have any concrete suggestions on what you would like to see that would make it easier for you to create task packages? |
From @natemcmaster on April 14, 2017 21:59 In a world of unlimited resources, I'd love to see this: <Project Sdk="Microsoft.Build.Task">
</Project> Microsoft.NET.Sdk is geared towards runtime packages, not MSBuild task packages. Packages designed to carry MSBuild tasks are fundamentally different from packages that only carry runtime bits. |
From @natemcmaster on April 14, 2017 22:18 @rohit21agrawal if you're looking for short-term fixes to the pack task... One of the problems today is that package authors have to choose between nuspec and csproj=>nuspec generation. Keeping csproj and nuspec aligned is difficult, esp. for users new to MSbuild. Wrangling MSBuild to make csproj=>nuspec generation work right is difficult, even for advanced MSBuild users. I had to read NuGet's source code to figure some of this out. Anything you can do to make nuspec + csproj easier would help with this ask. One idea: <package>
<metadata>
<id>${MSBuild.PackageId}</id>
<version>${MSBuild.PackageVersion}</version>
</metadata>
</package> |
From @rohit21agrawal on April 16, 2017 19:19 @natemcmaster instead of making csproj + nuspec easier, i'd like to understand more about what we can do to make the need for nuspec go away. |
From @natemcmaster on April 17, 2017 18:14
|
From @conniey on April 18, 2017 20:17 I think this issue overlaps with: dotnet/msbuild#1756 |
Given that this conversation is happening around pack, I am moving this issue over to NuGet. Please, re-activate or file new issues for specific asks for the SDK to support this. |
Here's another example of this with nasty workarounds: We need to call |
@onovotny I'm trying to do something similar. Could you please explain how you ended up with |
There is nothing special about the directory name or location; it comes from detecting core msbuild vs full here: https://github.com/paulcbetts/refit/blob/master/Refit/targets/refit.targets#L12-L13 We also needed a custom msbuild task base type ( Then in our main library we call publish on each TFM to get all the files we need in the publish output directory: And finally, include them in the package in the right location. Hope this helps! |
The point of all of this though is that's far too complicated and painful to create MSBuild tasks that work on both Full and Core MSBuild. |
@onovotny Thanks for the explanation. It seems that my target file is not getting included. Are there any obstacles you know about that? First tried with |
Your props/targets file has to match the package id for it to be automatically included. For Refit, that'd be |
I remember tripping over the same magic early this year when I wrote my first MSBuild target and tried to package it. |
This should be part of NuGet package analysis actually. /cc @emgarten |
From @natemcmaster on April 14, 2017 18:41
Can we get better support for projects designed to produce MSBuild tasks?
Pain points
Workarounds
Task assembly projects end up looking like this
Some MSBuild task projects in the wild:
madskristensen/BundlerMinifier
aspnet/BuildTools
natemcmaster/Yarn.MSBuild
Copied from original issue: dotnet/sdk#1125
The text was updated successfully, but these errors were encountered: