The cake docs cover items like addins, modules, etc., but does not explain what they are.
For example, the modules page has this: "The module directive lets you bootstrap Cake modules by downloading them from a NuGet source" - without defining a "module".
What is the difference between these concepts:
Aliases are convenience methods that are easily accessible directly from a Cake build. Every single DSL method in Cake is implemented like an alias method.
In the following example DeleteFile
and CleanDirectory
are aliases shipped by default with Cake:
Task("Clean")
.Does(() =>
{
// Delete a file.
DeleteFile("./file.txt");
// Clean a directory.
CleanDirectory("./temp");
});
See https://cakebuild.net/docs/fundamentals/aliases for details.
Addins can provide additional aliases to a Cake build. They are .NET assemblies shipped as NuGet packages.
See https://cakebuild.net/extensions/ for a list of available addins including the aliases they provide and https://cakebuild.net/docs/extending/addins/creating-addins for instructions how to create your own addins.
Modules are a special Cake component designed to augment, change or replace the internal logic of Cake itself. Modules can be used, for example, to replace the built-in Cake build log, process runner or tool locator, just to name a few. Internally, this is how Cake manages its "moving parts", but you can also load modules as part of running your build script, which will allow you to replace/change how Cake works as part of your build code.
See https://cakebuild.net/docs/extending/modules/ for details.
Cake build scripts can be published as NuGet packages, so called Recipes. These packages can contain shared tasks and can be consumed by other build scripts.
See https://cakebuild.net/docs/writing-builds/reusing-builds#recipe-nuget-packages for details about differences for sharing logic between multiple build scripts.
Extensions is the term used for addins, modules and recipes.
During a build you normally do tasks like compiling, linting, testing, etc. Cake itself is only a build orchestrator. For achieving the previously mentioned task Cake calls different tools (like MsBuid, NUnit, etc). Cake supports installing tools which are distributed as NuGet packages and provides logic to find tool locations during runtime.
See https://cakebuild.net/docs/writing-builds/tools/ for details.