You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,34 @@ Currently modules require "bootstrapping", so the first step before running the
60
60
61
61
### Other methods
62
62
63
-
You can also integrate this module into your own build process, even with a customised`build.ps1`/`build.sh`. As long as the `Cake.BuildSystems.Module` NuGet package is installed into your modules directory ([by default](https://cakebuild.net/docs/running-builds/configuration/default-configuration-values)`./tools/Modules`), `cake.exe` should pick them up when it runs. Note that you can also change your modules directory using the `cake.config` file or passing arguments to `cake.exe` as outlined in [the documentation](https://cakebuild.net/docs/running-builds/configuration/set-configuration-values)).
63
+
You can also integrate this module into your own build process, even with a customized`build.ps1`/`build.sh`. As long as the `Cake.BuildSystems.Module` NuGet package is installed into your modules directory ([by default](https://cakebuild.net/docs/running-builds/configuration/default-configuration-values)`./tools/Modules`), `cake.exe` should pick them up when it runs. Note that you can also change your modules directory using the `cake.config` file or passing arguments to `cake.exe` as outlined in [the documentation](https://cakebuild.net/docs/running-builds/configuration/set-configuration-values)).
64
64
65
-
### Versioning
65
+
### Cake.Frosting
66
+
67
+
While Cake script will load all modules automatically that are present in the modules directory, the same is not the case when using Cake.Frosting.
68
+
69
+
Before using Cake.Buildsystems.Module you have to reference the NuGet package either by adding `<PackageReference Include="Cake.BuildSystems.Module" Version="##see below for note on versioning##" />` to the `csproj` file of the build project, or by running `dotnet add package cake.buildsystems.module` in the folder of the build project.
70
+
71
+
To actually make use of the different modules included in Cake.Buildsystems.Module they need to be registered to the `CakeHost`. This can be done by using `ICakeHost.UseModule<TModule>()`. Typically the `CakeHost` is set up in the `Main` method of the build project. All modules included in Cake.Buildsystems.Module can be registered, regardless of the underlying build system, as each modules will only be triggered for the intended build system.
72
+
73
+
An example that registers all currently existing modules from Cake.Buildsystems.Module:
74
+
75
+
```csharp
76
+
publicstaticintMain(string[] args)
77
+
{
78
+
returnnewCakeHost()
79
+
// Register all modules from Cake.Buildsystems.Module
80
+
.UseModule<AzurePipelinesModule>()
81
+
.UseModule<MyGetModule>()
82
+
.UseModule<TravisCIModule>()
83
+
.UseModule<TeamCityModule>()
84
+
// continue with the "normal" setup of the CakeHost
85
+
.UseContext<BuildContext>()
86
+
.Run(args);
87
+
}
88
+
```
89
+
90
+
## Versioning
66
91
67
92
Note that since modules interact with the internals of Cake, they are tied to a specific version of Cake. The version of Cake supported by the particular module version will always be in the Release Notes of the NuGet package (and therefore also on [nuget.org](https://nuget.org/packages/Cake.BuildSystems.Module/)). Make sure to match this version number to the Cake version you're using.
0 commit comments