#build-lifecycle
Posts
-
Digging into Gradle's Source 2: The Big Picture — Client and Daemon, Service Scopes, and the Three Build Phases
A map of the Gradle source for intermediate developers opening it for the first time. We check against the real source and examples we ran ourselves which four processes take part in one gradle command, how the daemon's state is layered (process, session, build tree, build, project) and matched one-to-one with service scopes, which class and which state the initialization, configuration and execution phases really are, and how the model (Gradle, Settings, Project, Task) and the execution side (execution plan, nodes, execution engine) fit together — then lay out which part of this map each of parts 3 to 12 reads.
-
Digging into Gradle's Source 5: The Build Lifecycle — Where Initialization, Configuration and Execution Split
We follow, in the source of the reference commit, how a build request received by the daemon travels down a chain of executors to the build lifecycle, how StateTransitionController guards state transitions, how initialization reads init scripts and settings, how the configuration phase configures projects, where the configuration time barrier and the task graph sit, and how the build wraps up with buildFinished and the Flow API. We hook every lifecycle callback to print their order, read the build operation tree, and fail the build on purpose in each of the three phases.