Once an Android app has a dozen or more modules, every build.gradle.kts starts to repeat the same twenty lines: the Android plugin, compileSdk , minSdk , Java and Kotlin options, the Compose setup, the Hilt plugin and processor, the test dependencies. Bumping minSdk means editing every file, and forgetting one means a module that quietly builds differently from the rest.
Convention plugins fix that. A convention plugin is a small Gradle plugin you write yourself, which applies and configures other plugins the way your project wants. Each module then says what kind of module it is, a library or a feature, and the plugin supplies the how . Google's Now in Android sample is built this way, and Gradle's documentation recommends this approach over cross-project configuration with subprojects {} and allprojects {} .
buildSrc or build-logic
Gradle offers two places for shared build logic.
buildSrc is a special directory Gradle builds automatically before your project.β¦