|
1 |
| -This is a .NET based repository containing recipes for the Cake Build Automation System bundling individual Cake Issues addins. |
2 |
| -The individual recipes are published as NuGet packages. |
| 1 | +# Cake.Issues.Recipe |
3 | 2 |
|
4 |
| -See https://cakeissues.net/ for documentation and more information about Cake Issues. |
| 3 | +Cake.Issues.Recipe is a .NET repository containing recipes for the Cake Build Automation System bundling individual Cake Issues addins. The individual recipes are published as NuGet packages. The repository provides recipes for both Cake Scripting and Cake Frosting. |
5 | 4 |
|
6 |
| -Follow these guidelines when contributing: |
| 5 | +Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. |
7 | 6 |
|
8 |
| -## Before committing code |
9 |
| -- Ensure no warning or error messages from Roslyn analyzers are present in the code. |
10 |
| -- Ensure Unit Tests are passing. |
11 |
| -- Ensure Integration Tests are passing. |
| 7 | +## Working Effectively |
12 | 8 |
|
13 |
| -## Development Flow |
14 |
| -- Only building: `build.sh --target=DotNetCore-Build` |
15 |
| -- Publish NuGet Packages: `build.sh --target=Create-NuGet-Packages` |
16 |
| -- Run Unit Tests: `build.sh --target=Test` |
17 |
| -- Run Integration Tests: |
18 |
| - - Run first `build.sh --target=Create-NuGet-Packages` in the root directory to create the NuGet packages. |
19 |
| - - Run `build.sh` in the `tests/<RECIPE-NAME>/<TEST>` directory to run the integration tests for the corresponding recipe |
20 |
| -- Full CI check: `build.sh` (includes build, publish, test) |
| 9 | +### Prerequisites |
| 10 | +- Install .NET 8 and .NET 9 SDKs |
| 11 | +- For integration tests: Install `markdownlint-cli` globally: `npm install -g markdownlint-cli` |
21 | 12 |
|
22 |
| -To have verbose output of build.sh the following parameter can be add `--verbosity=diagnostic` |
| 13 | +### Bootstrap, build, and test the repository |
| 14 | +- Make build script executable: `chmod +x build.sh` |
| 15 | +- Full build and test: `./build.sh` -- takes 40 seconds. NEVER CANCEL. Set timeout to 120+ seconds. |
| 16 | +- Build only: `./build.sh --target=DotNetCore-Build` -- takes 2.5 minutes. NEVER CANCEL. Set timeout to 300+ seconds. |
| 17 | +- Run unit tests: `./build.sh --target=Test` -- takes 30 seconds. NEVER CANCEL. Set timeout to 120+ seconds. |
| 18 | +- Create NuGet packages: `./build.sh --target=Create-NuGet-Packages` -- takes 30 seconds. NEVER CANCEL. Set timeout to 120+ seconds. |
| 19 | + |
| 20 | +### Check available build targets |
| 21 | +- View all targets: `./build.sh --tree` |
| 22 | +- Get help: `./build.sh --help` |
| 23 | +- Verbose output: `./build.sh --verbosity=diagnostic` |
| 24 | + |
| 25 | +### Run integration tests |
| 26 | +- ALWAYS run `./build.sh --target=Create-NuGet-Packages` first in the root directory to create NuGet packages |
| 27 | +- Run specific integration test: |
| 28 | + - `cd tests/script-runner/net8.0-git-cli/` |
| 29 | + - `chmod +x build.sh && ./build.sh` -- takes 20 seconds. NEVER CANCEL. Set timeout to 120+ seconds. |
| 30 | +- Integration tests validate the recipes work correctly with sample projects |
| 31 | + |
| 32 | +## Validation |
| 33 | + |
| 34 | +### Build validation steps |
| 35 | +- ALWAYS run the full build after making changes: `./build.sh` |
| 36 | +- Run unit tests: `./build.sh --target=Test` |
| 37 | +- For recipe changes, ALWAYS run integration tests to ensure recipes work correctly |
| 38 | +- Check build artifacts in `BuildArtifacts/Packages/NuGet/` after package creation |
| 39 | + |
| 40 | +### Code quality requirements |
| 41 | +- Ensure no warning or error messages from Roslyn analyzers are present |
| 42 | +- Unit tests must pass |
| 43 | +- Integration tests must pass |
| 44 | +- Build artifacts must be created successfully |
23 | 45 |
|
24 | 46 | ## Repository Structure
|
25 |
| -- `Cake.Frosting.Issues.Recipe`: Contains the source code for the recipe for use with Cake Frosting |
26 |
| -- `Cake.Issues.Recipe`: Contains the source code for the recipe for use with Cake Scripting |
27 |
| -- `nuspec/nuget`: Contains the NuGet specification files for the Cake Scripting addin |
28 |
| -- `tests`: Contains integration tests for the recipes |
29 |
| -- `.github/workflows`: Contains GitHub Actions workflows for CI/CD which need to be maintained |
30 |
| -- `.azuredevops/pipelines/templates`: Contains Azure Pipelines templates which need to be maintained. The main file is `azure-pipelines.yml` in the root directory. |
31 |
| - |
32 |
| -## Key Guidelines |
| 47 | + |
| 48 | +### Key projects |
| 49 | +- `Cake.Issues.Recipe/`: Contains the source code for the recipe for use with Cake Scripting |
| 50 | +- `Cake.Frosting.Issues.Recipe/`: Contains the source code for the recipe for use with Cake Frosting |
| 51 | + - `Cake.Frosting.Issues.Recipe.csproj`: Main Frosting recipe project |
| 52 | + - `Cake.Frosting.Issues.Recipe.Tests.csproj`: Unit tests for Frosting recipe |
| 53 | +- `nuspec/nuget/`: Contains NuGet specification files for the Cake Scripting addin |
| 54 | +- `tests/`: Contains integration tests for both recipes |
| 55 | + - `script-runner/`: Integration tests for Cake Scripting recipe |
| 56 | + - `frosting/`: Integration tests for Cake Frosting recipe |
| 57 | +- `.github/workflows/`: GitHub Actions workflows for CI/CD |
| 58 | +- `.azuredevops/pipelines/`: Azure Pipelines templates |
| 59 | +- `azure-pipelines.yml`: Main Azure DevOps pipeline configuration |
| 60 | + |
| 61 | +### Build system |
| 62 | +- Uses Cake.Recipe (meta-build system for Cake addins) |
| 63 | +- Main build configuration: `recipe.cake` |
| 64 | +- Build scripts: `build.sh` (Linux/macOS), `build.ps1` (Windows) |
| 65 | +- Uses GitVersion for semantic versioning |
| 66 | + |
| 67 | +### Common commands reference |
| 68 | + |
| 69 | +#### Repository root contents |
| 70 | +``` |
| 71 | +.appveyor.yml |
| 72 | +.azuredevops/ |
| 73 | +.config/ |
| 74 | +.github/ |
| 75 | +.gitignore |
| 76 | +.vscode/ |
| 77 | +CONTRIBUTING.md |
| 78 | +Cake.Frosting.Issues.Recipe/ |
| 79 | +Cake.Issues.Recipe/ |
| 80 | +GitReleaseManager.yaml |
| 81 | +LICENSE |
| 82 | +README.md |
| 83 | +azure-pipelines.yml |
| 84 | +build.ps1 |
| 85 | +build.sh |
| 86 | +nuspec/ |
| 87 | +recipe.cake |
| 88 | +tests/ |
| 89 | +``` |
| 90 | + |
| 91 | +#### Available build targets (most commonly used) |
| 92 | +- `Build`: Build all projects |
| 93 | +- `Test`: Run unit tests |
| 94 | +- `Package`: Create NuGet packages and run full validation |
| 95 | +- `Create-NuGet-Packages`: Create NuGet packages only |
| 96 | +- `DotNetCore-Build`: Build without tests or packaging |
| 97 | +- `DotNetCore-Restore`: Restore NuGet packages only |
| 98 | + |
| 99 | +#### Integration test structure |
| 100 | +- Each test has variants for .NET 8/9 and different repository providers (git-cli, cake-git) |
| 101 | +- Tests contain sample projects that demonstrate recipe functionality |
| 102 | +- Tests validate issues are detected and reported correctly |
| 103 | + |
| 104 | +## Development Guidelines |
| 105 | + |
| 106 | +### Key principles |
33 | 107 | 1. Maintain existing code structure and organization
|
34 |
| -2. Write unit tests for new functionality. |
35 |
| -3. Write integration tests for new functionality which can't be tested with unit tests. |
36 |
| -4. Ensure Cake.Issues.Recipe and Cake.Frosting.Issues.Recipe are kept in sync regarding the features they provide. |
| 108 | +2. Write unit tests for new functionality |
| 109 | +3. Write integration tests for functionality that can't be tested with unit tests |
| 110 | +4. Ensure Cake.Issues.Recipe and Cake.Frosting.Issues.Recipe are kept in sync regarding features |
| 111 | + |
| 112 | +### Making changes |
| 113 | +- ALWAYS test both unit tests and integration tests after changes |
| 114 | +- Both Cake Scripting and Cake Frosting recipes should provide equivalent functionality |
| 115 | +- Recipe changes often require updates to both variants |
| 116 | +- Integration tests must pass to ensure recipes work in real scenarios |
| 117 | + |
| 118 | +### CI/CD compatibility |
| 119 | +- The build runs on Windows, macOS, and Ubuntu across multiple .NET versions |
| 120 | +- GitHub Actions and Azure DevOps are both used for CI |
| 121 | +- AppVeyor is also used for some builds |
| 122 | + |
| 123 | +### Common tasks timing reference |
| 124 | +- Tool restoration: ~5 seconds |
| 125 | +- .NET restore: ~30 seconds |
| 126 | +- Build (first time): ~2.5 minutes |
| 127 | +- Build (incremental): ~10 seconds |
| 128 | +- Unit tests: ~30 seconds |
| 129 | +- NuGet package creation: ~30 seconds |
| 130 | +- Integration test: ~20 seconds per test |
| 131 | +- Full build: ~40 seconds |
| 132 | + |
| 133 | +### Troubleshooting |
| 134 | +- If markdownlint fails in integration tests: Install `markdownlint-cli` with `npm install -g markdownlint-cli` |
| 135 | +- Build warnings about deprecated packages are expected and can be ignored |
| 136 | +- Some assembly load warnings during build are expected and can be ignored |
| 137 | +- Integration tests create sample code with intentional issues for validation |
0 commit comments