4

We have some nuget packages on a network drive that I'd like to be able to reference in my Cake script. The absolute path to the drive looks something like this:

\\MyDrive\NuGet\Packages\mypackage.nupkg

Is there any way to reference this package using preprocessor directives as explained here: http://cakebuild.net/docs/fundamentals/preprocessor-directives#tool-directive

If not, how would I go about doing it without preprocessor directives? Thanks.

Ryan
  • 105
  • 1
  • 1
  • 5
  • 1
    I don't know anything about cake but you can list alternate package sources in a NuGet.config file. So if you can do a nuget restore it should work. – Crowcoder Jul 19 '17 at 19:55

1 Answers1

3

The Cake pre-processor directive, in addition to the http protocol, also supports the file protocol. As a result, you can so something like the following

#tool nuget:file://localhost/packages/?package=restsharp
Gary Ewan Park
  • 17,610
  • 5
  • 42
  • 60