Adds Paket support to Cake via a Cake addin and module.
Allows the use of paket preprocessor directives and commands
// tools
#tool paket:?package=NUnit.ConsoleRunner&group=main
#tool paket:?package=JetBrains.ReSharper.CommandLineTools
// addins
#addin paket:?package=Cake.Figlet&group=build/setup
#addin paket:?package=Cake.Paket
...
// Restores packages
Task("Paket-Restore").Does(() =>
{
PaketRestore();
});
// Creates a nuget package
Task("Paket-Pack").Does(() =>
{
PaketPack("./NuGet");
});
// Push a nuget package
Task("Paket-Push").IsDependentOn("Paket-Pack").Does(() =>
{
PaketPush("./NuGet/foo.nupkg", new PaketPushSettings { ApiKey = "00000000-0000-0000-0000-000000000000" });
});
...
instead of using NuGet
// tools
#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
#tool nuget:?package=JetBrains.ReSharper.CommandLineTools
// addins
#addin nuget:?package=Cake.Figlet&version=0.3.1
...
// Restores packages
Task("NuGet-Restore").Does(() =>
{
NuGetRestore("solution.sln");
});
// Creates a nuget pacakge
Task("NuGet-Pack").Does(() =>
{
NuGetPack("bar.nuspec", new NuGetPackSettings{OutputDirectory = "./NuGet"});
});
// Push a nuget pacakge
Task("NuGet-Push").IsDependentOn("Paket-Pack").Does(() =>
{
NuGetPush("./NuGet/foo.nupkg", new NuGetPushSettings{ApiKey = "00000000-0000-0000-0000-000000000000"});
});
...
If you want to use paket instead of nuget in the preprocessor directive e.g. #tool paket:?package=Cake.Foo
and/or #addin paket:?package=Cake.Bar
then you need to use Cake.Paket.Module.
- Get the modified cake bootstrapper script, then create a tools dependency group and add Cake to your paket.dependencies file
group tools
source https://nuget.org/api/v2
nuget Cake
- Create a modules dependency group and add Cake.Paket.Module to your paket.dependencies file
group modules
source https://nuget.org/api/v2
nuget Cake.Paket.Module
- Now you can use paket instead of nuget in the preprocessor directive.
If you need to use paket commands such as restore, pack, and push then add #addin paket:?package=Cake.Paket
if your using the Cake.Paket.Module, otherwise add #addin nuget:?package=Cake.Paket
and #tool nuget:?package=Paket
.
Note that if you use #addin nuget:?package=Cake.Paket
you can use the cake teams default bootstrappers build.ps1 and/or build.sh.
Cake.Paket.Example is an example project which uses Paket with Cake. Additionally, the project for the paket addin and module is another good resource, see setup.cake.
- See the Documentation for additional help.
- Cake's sites contains documentation of the addin at Cake.Paket.
All types of contributions are welcome!