DevOps / Gradle8 Interview Questions
How do you configure a composite build with included builds?
A composite build lets one Gradle build transparently substitute a dependency with the output of another, separate Gradle build — useful for developing a library and the application consuming it side by side, without publishing the library to a repository first for every small change.
// settings.gradle of the consuming project includeBuild '../shared-library'
// app/build.gradle dependencies { implementation 'com.example:shared-library:1.0.0' // resolved from the included build instead }
Gradle automatically substitutes any dependency coordinate matching what the included build produces, so the consuming project's dependency declaration doesn't need to change at all — it looks like a normal published dependency, but Gradle builds it fresh from source as needed. This differs from a plain multi-project build's subprojects: an included build remains a fully independent, separately publishable Gradle build with its own settings.gradle, and can even be included by multiple unrelated consuming projects, which buildSrc and ordinary subprojects can't do.
More Related questions...
