Skip to content

Commit 28e37a3

Browse files
authored
Merge pull request #95 from nils-a/release/3.1.0
Release/3.1.0
2 parents 9f00e90 + 4cccd4e commit 28e37a3

23 files changed

Lines changed: 221 additions & 67 deletions

File tree

.appveyor.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,36 @@ jobs:
2323

2424
steps:
2525
- name: Checkout the repository
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v2.4.0
2727

2828
- name: Fetch all tags and branches
2929
run: git fetch --prune --unshallow
3030

31+
- uses: actions/setup-dotnet@v1.8.2
32+
with:
33+
# codecov and unittests need 2.1
34+
dotnet-version: '2.1.818'
35+
- uses: actions/setup-dotnet@v1.8.2
36+
with:
37+
dotnet-version: '3.1.414'
38+
- uses: actions/setup-dotnet@v1.8.2
39+
with:
40+
# gitversion needs 5.0
41+
dotnet-version: '5.0.402'
42+
- uses: actions/setup-dotnet@v1.8.2
43+
with:
44+
# need at least .NET 6 rc2 to build
45+
dotnet-version: '6.0.100-rc.2.21505.57'
46+
include-prerelease: true
47+
3148
- name: Cache Tools
32-
uses: actions/cache@v2
49+
uses: actions/cache@v2.1.6
3350
with:
3451
path: tools
3552
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
3653

3754
- name: Build project
38-
uses: cake-build/cake-action@v1
55+
uses: cake-build/cake-action@v1.4.0
3956
with:
4057
script-path: recipe.cake
4158
target: CI

.github/workflows/codeql-analysis.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,29 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v2.4.0
2424
with:
2525
fetch-depth: 0
2626

27+
- uses: actions/setup-dotnet@v1.8.2
28+
with:
29+
# codecov and unittests need 2.1
30+
dotnet-version: '2.1.818'
31+
- uses: actions/setup-dotnet@v1.8.2
32+
with:
33+
dotnet-version: '3.1.414'
34+
- uses: actions/setup-dotnet@v1.8.2
35+
with:
36+
# gitversion needs 5.0
37+
dotnet-version: '5.0.402'
38+
- uses: actions/setup-dotnet@v1.8.2
39+
with:
40+
# need at least .NET 6 rc2 to build
41+
dotnet-version: '6.0.100-rc.2.21505.57'
42+
include-prerelease: true
43+
2744
- name: Cache Tools
28-
uses: actions/cache@v2
45+
uses: actions/cache@v2.1.6
2946
with:
3047
path: tools
3148
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
@@ -36,7 +53,7 @@ jobs:
3653
languages: ${{ matrix.language }}
3754

3855
- name: Build project
39-
uses: cake-build/cake-action@v1
56+
uses: cake-build/cake-action@v1.4.0
4057
with:
4158
script-path: recipe.cake
4259
target: DotNetCore-Build

.github/workflows/dependabot-cake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
runs-on: ubuntu-latest # linux, because this is a docker-action
1111
steps:
1212
- name: check/update cake dependencies
13-
uses: nils-org/dependabot-cake-action@v1
13+
uses: nils-org/dependabot-cake-action@v1.1.0

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cSpell.words": [
3+
"Buildsystems",
4+
"nuget"
5+
]
6+
}

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,34 @@ Currently modules require "bootstrapping", so the first step before running the
6060

6161
### Other methods
6262

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)).
6464

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+
public static int Main(string[] args)
77+
{
78+
return new CakeHost()
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
6691

6792
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.
6893

azure-pipelines.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

demo/dsl/.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"cake.tool": {
6+
"version": "1.1.0",
7+
"commands": [
8+
"dotnet-cake"
9+
]
10+
}
11+
}
12+
}

demo/dsl/build.cake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#module nuget:?package=Cake.BuildSystems.Module&version=3.0.3
2+
3+
///////////////////////////////////////////////////////////////////////////////
4+
// ARGUMENTS
5+
///////////////////////////////////////////////////////////////////////////////
6+
7+
var target = Argument("target", "Default");
8+
9+
///////////////////////////////////////////////////////////////////////////////
10+
// TASKS
11+
///////////////////////////////////////////////////////////////////////////////
12+
13+
Task("Default")
14+
.Does(() => {
15+
Information("Hello Cake!");
16+
Verbose("This is really verbose.");
17+
Warning("This is a warning.");
18+
Debug("This is a debug-message.");
19+
Information("Next comes the error:");
20+
Error("This is an error.");
21+
});
22+
23+
RunTarget(target);

demo/dsl/build.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
Set-Location -LiteralPath $PSScriptRoot
4+
5+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
6+
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
7+
$env:DOTNET_NOLOGO = '1'
8+
9+
dotnet tool restore
10+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
11+
12+
dotnet cake @args
13+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)