Reputation: 18981
I want to make use of some of the new features that are available in the soon to be released version of Cake. What modifications do I have to make to the bootstrapper and packages.config file in order to download the latest pre-release version, rather than the latest released version.
Upvotes: 0
Views: 178
Reputation: 18981
By default, when restoring packages through the Cake Bootstrapper, a default source of nuget.org is used to locate packages. Cake only pushes released versions to nuget.org, and instead pushes pre-release versions of Cake to it's MyGet Feed. You can find out more information about how Cake uses MyGet here.
In order to consume the latest pre-release version of Cake within your build script, a modification to the default bootstrapper will be required.
Assuming you are using the latest bootstrapper from here then this is the line that you are going to need to change.
From this:
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
to this:
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source https://www.myget.org/F/cake/api/v3/index.json"
Or, if you are running on Linux/OSX, you would need to change this line of your build.sh from this:
mono "$NUGET_EXE" install -ExcludeVersion
to this:
mono "$NUGET_EXE" install -ExcludeVersion -PreRelease -Source https://www.myget.org/F/cake/api/v3/index.json"
On top of that, you will also need to update your packages.config file in the tools folder, to specify which pre-release version you would like to use. At the time of writing, the latest version available is 0.18.0-alpha0105
so you would need the following:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.18.0-alpha0105" />
</packages>
Upvotes: 1