Gradle, From Zero
You opened a Java or Android project, saw build.gradle, ran ./gradlew build, and a wall of text scrolled past for ninety seconds. Then someone told you to "add a dependency" and you had no idea whether to write implementation, api, or compile, or why your change quietly broke a downstream module. Gradle feels like a black box that occasionally yells at you.
It isn't a black box. Gradle is a small, learnable idea wrapped in a big vocabulary: your build is a graph of tasks, your config is real code, and the speed comes from Gradle refusing to redo work it has already done. Once you see the graph, the rest stops being mysterious.
How to read this
Go in order. Phase 1 gives you the mental model: tasks, the build graph, and why Gradle exists at all. Phase 2 is the everyday work: writing build.gradle(.kts), applying plugins, and declaring dependencies the right way. Phase 3 is the speed and the sharp edges: incremental builds, the build cache, the wrapper, and the gotchas that bite real teams. Read with a terminal open; run the commands as you go.
The phases
- Phase 1: The Build Is a Graph - what Gradle actually is, tasks, and the task DAG
- Phase 2: The Build Script You Live In - the DSL, plugins, and dependency configurations
- Phase 3: Why It's Fast, and Where It Bites - incremental builds, the cache, the wrapper, and gotchas