Gradle Convention Plugins
summary
Gradle convention plugins centralize module configuration but only pay off when written cache-friendly: prefer binary (standard) plugins over script plugins, use tasks.register and the Provider API for lazy values, annotate task inputs/outputs and implement configuration cache compatible API. Put plugins into composite builds or publish to a Maven repo; avoid buildSrc unless on Gradle 8+ because older buildSrc/composite setups caused heavy recompilation (Square reported regressions). For Android, hook into onVariants/beforeVariant rather than mutating frozen Android extensions.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:45Self-introduction and background
- 2:47Gradle convention plugins
- 4:31Convention plugins vs scripts
- 5:38Gradle build mechanics
- 9:16Build lifecycle explained
- 12:53Enabling composite builds
- 16:09Plugin project styles
- 18:05Plugin development languages
- 19:53Plugin API best practices
- 23:28Configuration caching
- 24:52Android Gradle tips
- 28:07Advanced Gradle practices
- 29:57Summary
related talks
26mGoodness, Gracious, Great Builds of Gradle
42mWriting your own Gradle Plugin: A Deep Dive
56mDeep Dive into the Android Gradle Plugin
33mUnderstanding Gradle and writing your own Gradle Plugin
28mEffective Gradle Scripts for Android Projects
35mThe Benevolent Gradle Overlord: Keeping Order
32m5 ways to improve your Android build productivity
39mAndroid Gradle Plugin internals
