As stated on the Preprocessor directives page on cakebuild.net, the #addin
directive also supports an URI syntax (#addin nuget:[uri]?package=packageid[¶meters]
) which can be used to specify parameters like feed, version & prerelease.
Example usage:
#addin nuget:?package=Cake.Foo
#addin nuget:?package=Cake.Foo&version=1.2.3
#addin nuget:?package=Cake.Foo&prerelease
#addin nuget:https://myget.org/f/Cake/?package=Cake.Foo&prerelease
You can also override the default nuget location for all addins by specifying the NUGET_SOURCE
environment variable, the --nuget_source
argument to Cake or adding a config file like below
[Nuget]
Source=http://myfeed/nuget/
You save it as cake.config
and place it along your build.cake
file.
You can read more about Cake configuration here and the default values here
But to fetch latest prerelease version I would suggest going with #addin nuget:[feedurl]?package=[packageid]&prerelease
syntax.