Cake - install dotnet core tool

让人想犯罪 __ 提交于 2019-12-11 17:43:07

问题


I have a build.cake file where I need an external dotnet tool package installed. I would prefer managing installation of that tool in the cake file itself, so other people do not have to be aware that they need one more tool to be installed to be able to build the repository.

Is it possible to install it using #tool directive same way as for Nuget packages? Or do I need to use DotNetCoreTool() method for that purpose? Or probably there is another way?


回答1:


UPDATE: This functionality is now provided. An introduction blog post about it is here:

https://www.gep13.co.uk/blog/introducing-cake.dotnettool.module

ORIGINAL ANSWER:

There is nothing available "yet" that will allow you to do this. However, as early as yesterday (you have incredible timing!!) I have been working on a new module for Cake which will allow you to do exactly what you are asking. Once it is ready, the module will be available here:

https://github.com/cake-contrib/Cake.DotNetTool.Module

Once ready, you will be able to do something like the following:

#tool "dotnet:?package=Octopus.DotNet.Cli"

And it will take care of installing the required Global Tool. The pre-processor directive will have the ability to specify additional parameters, including:

  • tool path
  • version
  • source
  • framework
  • config file

I will update this answer once the initial version is published for you to take a look at.



来源:https://stackoverflow.com/questions/52477022/cake-install-dotnet-core-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!