Skip to content

Support pack of global tools (PackAsTool) - #3208

Merged
forki merged 4 commits into
fsprojects:masterfrom
enricosada:paket_and_global_tool
May 18, 2018
Merged

Support pack of global tools (PackAsTool)#3208
forki merged 4 commits into
fsprojects:masterfrom
enricosada:paket_and_global_tool

Conversation

@enricosada

@enricosada enricosada commented May 17, 2018

Copy link
Copy Markdown
Contributor

require .net sdk >= 2.1.300

using PackAsTool with Pack target, allow to create tools (for .net core are FDD)

this PR:

  • remove the deps from generated nuspec
  • set the deps assemblies so are added to nupkg

if is just a console app (no p2p, deps are ok).

dotnet new console -lang f#
dotnet pack /p:PackAsTool=true

if you want, just put the nupkg in a reachable feed (local is ok), and do dotnet tool install mytool -g (global) or dotnet tool install mytool --tool-path "%CD%\dir_with_tools" (to put tools in dir_with_tools, so dir_with_tools\mytool will work)

if is a console app with p2p, put the PackAsTool property inside the fsproj, otherwise the p2p deps are not added in the nupkg.

NOTE if we modify the condition to check the type (lib vs exe), will be possibile to allow also /p:PackAsTool=true with p2p, but i dont care atm

dotnet new console -lang f#
# put the PackAsTool property in fsproj
dotnet pack

Tests are disabled atm (but works), i'll upgrade everything to 2.1.300-rc1 with #3183 so can be run

@enricosada
enricosada requested review from forki and matthid May 17, 2018 17:24
@enricosada

Copy link
Copy Markdown
Contributor Author

/cc @matthid if you need that for FAKE. i needed for #3183

@enricosada

enricosada commented May 17, 2018

Copy link
Copy Markdown
Contributor Author

@forki @matthid ready to review for merge!

@matthid matthid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes looks good! We just need to remember to enable the tests later on, maybe we can add a bullet-point in the linked PR.

@enricosada enricosada mentioned this pull request May 17, 2018
4 tasks
@forki
forki merged commit 04b7d9d into fsprojects:master May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants