# cake-build/cake architecture

> Architecture diagram of the GitHub repository cake-build/cake, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cake-build/cake
- Repository: https://github.com/cake-build/cake

## Overview

Cake is a C#-DSL build automation system. A user supplies a build script or Frosting task set; Cake registers targets and lifecycle actions, executes the requested target graph, and reports the run. The README documents build tasks such as compilation, file operations, testing, compression, and NuGet packaging. The graph captures the engine and the sampled Frosting path, plus the documented capability areas. Several CLI-to-runtime and tool-dispatch links are not visible in the excerpts, so they are omitted rather than inferred.

Main entry points: [`src/Cake.Common`](https://github.com/cake-build/cake/tree/develop/src/Cake.Common) (Script aliases), [`src/Cake.Core/ICakeContext.cs`](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/ICakeContext.cs) (Cake context), [`src/Cake.Frosting/Internal/FrostingEngine.cs`](https://github.com/cake-build/cake/blob/develop/src/Cake.Frosting/Internal/FrostingEngine.cs) (Frosting engine), [`src/Cake.Core/CakeEngine.cs`](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngine.cs) (Cake engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and scripting"]
  node_cli["Cake CLI<br/>[Program.cs]"]
  node_script["Roslyn scripting"]
  node_frosting["Frosting engine<br/>[FrostingEngine.cs]"]
end

subgraph group_execution["Task execution"]
  node_tasks["Task registry<br/>[CakeTask.cs]"]
  node_engine["Cake engine<br/>[CakeEngine.cs]"]
  node_lifecycle["Lifecycle actions"]
  node_report["Execution report<br/>[CakeEngine.cs]"]
end

subgraph group_capabilities["Build capabilities"]
  node_common["Script aliases<br/>[Cake.Common]"]
  node_files["File operations<br/>[IO]"]
  node_process["Process operations<br/>[ProcessAliases.cs]"]
  node_tooling["Build tools<br/>[Tools]"]
  node_compression["Archive operations<br/>[ZipAliases.cs]"]
  node_packages["Package operations<br/>[NuGet]"]
end

subgraph group_runtime["Runtime services"]
  node_context["Cake context<br/>[ICakeContext.cs]"]
  node_filesystem["File system<br/>[IFileSystem.cs]"]
  node_environment["Environment"]
  node_runner["Process runner<br/>[IProcessRunner.cs]"]
  node_tool_locator["Tool locator<br/>[IToolLocator.cs]"]
end

node_user(("Build author"))
node_external_tools["External build tools"]

node_user -->|"runs scripts"| node_cli
node_user -->|"defines tasks"| node_frosting
node_frosting -->|"registers tasks"| node_tasks
node_frosting -->|"registers actions"| node_engine
node_engine -->|"registers actions"| node_lifecycle
node_engine -->|"records results"| node_report
node_script -.->|"exposes DSL"| node_common
node_common -->|"supports file work"| node_files
node_common -->|"supports processes"| node_process
node_common -.->|"invokes tools"| node_tooling
node_common -->|"supports compression"| node_compression
node_common -->|"supports packaging"| node_packages
node_context -->|"exposes"| node_filesystem
node_context -->|"exposes"| node_environment
node_context -->|"exposes"| node_runner
node_context -->|"exposes"| node_tool_locator
node_tooling -.->|"runs tools"| node_external_tools

click node_cli "https://github.com/cake-build/cake/blob/develop/src/Cake/Program.cs"
click node_script "https://github.com/cake-build/cake/blob/develop/src/Cake/Infrastructure/Scripting/RoslynScriptEngine.cs"
click node_frosting "https://github.com/cake-build/cake/blob/develop/src/Cake.Frosting/Internal/FrostingEngine.cs"
click node_tasks "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeTask.cs"
click node_engine "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngine.cs"
click node_lifecycle "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngineActions.cs"
click node_report "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngine.cs"
click node_common "https://github.com/cake-build/cake/tree/develop/src/Cake.Common"
click node_files "https://github.com/cake-build/cake/tree/develop/src/Cake.Common/IO"
click node_process "https://github.com/cake-build/cake/blob/develop/src/Cake.Common/ProcessAliases.cs"
click node_tooling "https://github.com/cake-build/cake/tree/develop/src/Cake.Common/Tools"
click node_compression "https://github.com/cake-build/cake/blob/develop/src/Cake.Common/IO/ZipAliases.cs"
click node_packages "https://github.com/cake-build/cake/tree/develop/src/Cake.Common/Tools/NuGet"
click node_context "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/ICakeContext.cs"
click node_filesystem "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/IO/IFileSystem.cs"
click node_environment "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/ICakeEnvironment.cs"
click node_runner "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/IO/IProcessRunner.cs"
click node_tool_locator "https://github.com/cake-build/cake/blob/develop/src/Cake.Core/Tooling/IToolLocator.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_script,node_frosting toneBlue
class node_tasks,node_engine,node_lifecycle,node_report toneAmber
class node_common,node_files,node_process,node_tooling,node_compression,node_packages toneMint
class node_context,node_filesystem,node_environment,node_runner,node_tool_locator toneRose
class node_user,node_external_tools toneIndigo
```

## Components

### Entry and scripting

- [Cake CLI](https://github.com/cake-build/cake/blob/develop/src/Cake/Program.cs): `src/Cake/Program.cs`
- [Roslyn scripting](https://github.com/cake-build/cake/blob/develop/src/Cake/Infrastructure/Scripting/RoslynScriptEngine.cs): `src/Cake/Infrastructure/Scripting/RoslynScriptEngine.cs`
- [Frosting engine](https://github.com/cake-build/cake/blob/develop/src/Cake.Frosting/Internal/FrostingEngine.cs): `src/Cake.Frosting/Internal/FrostingEngine.cs`

### Task execution

- [Task registry](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeTask.cs): `src/Cake.Core/CakeTask.cs`
- [Cake engine](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngine.cs): `src/Cake.Core/CakeEngine.cs`
- [Lifecycle actions](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngineActions.cs): `src/Cake.Core/CakeEngineActions.cs`
- [Execution report](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/CakeEngine.cs): `src/Cake.Core/CakeEngine.cs`

### Build capabilities

- [Script aliases](https://github.com/cake-build/cake/tree/develop/src/Cake.Common): `src/Cake.Common`
- [File operations](https://github.com/cake-build/cake/tree/develop/src/Cake.Common/IO): `src/Cake.Common/IO`
- [Process operations](https://github.com/cake-build/cake/blob/develop/src/Cake.Common/ProcessAliases.cs): `src/Cake.Common/ProcessAliases.cs`
- [Build tools](https://github.com/cake-build/cake/tree/develop/src/Cake.Common/Tools): `src/Cake.Common/Tools`
- [Archive operations](https://github.com/cake-build/cake/blob/develop/src/Cake.Common/IO/ZipAliases.cs): `src/Cake.Common/IO/ZipAliases.cs`
- [Package operations](https://github.com/cake-build/cake/tree/develop/src/Cake.Common/Tools/NuGet): `src/Cake.Common/Tools/NuGet`

### Runtime services

- [Cake context](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/ICakeContext.cs): `src/Cake.Core/ICakeContext.cs`
- [File system](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/IO/IFileSystem.cs): `src/Cake.Core/IO/IFileSystem.cs`
- [Environment](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/ICakeEnvironment.cs): `src/Cake.Core/ICakeEnvironment.cs`
- [Process runner](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/IO/IProcessRunner.cs): `src/Cake.Core/IO/IProcessRunner.cs`
- [Tool locator](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/Tooling/IToolLocator.cs): `src/Cake.Core/Tooling/IToolLocator.cs`

### Other components

- **Build author**
- **External build tools**

## Connections

- Build author → Cake CLI: runs scripts (evidence: `README.md`)
- Build author → Frosting engine: defines tasks (evidence: `README.md`)
- Frosting engine → Task registry: registers tasks (evidence: `src/Cake.Frosting/Internal/FrostingEngine.cs`)
- Frosting engine → Cake engine: registers actions (evidence: `src/Cake.Frosting/Internal/FrostingEngine.cs`)
- Cake engine → Lifecycle actions: registers actions (evidence: `src/Cake.Core/CakeEngine.cs`)
- Cake engine → Execution report: records results (evidence: `src/Cake.Core/CakeEngine.cs`)
- Roslyn scripting → Script aliases: exposes DSL
- Script aliases → File operations: supports file work (evidence: `README.md`)
- Script aliases → Process operations: supports processes (evidence: `README.md`)
- Script aliases → Build tools: invokes tools (evidence: `src/Cake.Common/Tools/GitReleaseManager/GitReleaseManagerAliases.cs`)
- Script aliases → Archive operations: supports compression (evidence: `README.md`)
- Script aliases → Package operations: supports packaging (evidence: `README.md`)
- Cake context → File system: exposes (evidence: `src/Cake.Core/ICakeContext.cs`)
- Cake context → Environment: exposes (evidence: `src/Cake.Core/ICakeContext.cs`)
- Cake context → Process runner: exposes (evidence: `src/Cake.Core/ICakeContext.cs`)
- Cake context → Tool locator: exposes (evidence: `src/Cake.Core/ICakeContext.cs`)
- Build tools → External build tools: runs tools
