Gradle Cache Internals
What lives inside the Gradle user home, what is portable across machines, and what must be excluded.
IMPORTANT: Developer documentation for the current development branch. This content is unreleased, may change without notice, and must not be treated as Buildish release documentation.
These documents describe the internal design of Mammoth Cache — intended for contributors, maintainers, and anyone who wants to understand why the action behaves the way it does.
The core model is shared between Gradle and Maven: the same two-phase lifecycle, cache model,
key generation, delta exchange protocol, and CI abstraction layer underpin both. Build-tool-specific
behaviour is isolated behind a BuildToolAdapter interface so the shared phase logic never imports
tool-specific code.
What lives inside the Gradle user home, what is portable across machines, and what must be excluded.
What lives inside the Maven local repository, what is portable across runners, and what must be excluded.
Base cache restore/save lifecycle, timestamp garbage collection, prune-managed cleanup, and the distributed delta exchange model.
How compatible cache families, ref lineages, and immutable generations are constructed and restored.
How Mammoth Cache packages, names, and exchanges per-worker cache deltas between distributed jobs.
How the action initializes configuration, the cache model, and the build tool adapter (Gradle or Maven) before handing off to the build.
How the action discovers, downloads, and verifies gradle-wrapper.jar files before the build runs.
How the action separates CI-platform-specific logic from the shared core, and the rules that keep new provider adapters honest.