Bazel in the Inner Loop: From Monorepo Graph to Focused Sync
See how Bazel’s dependency graph can separate build scope from IDE scope, helping engineers move through large monorepos without syncing every module.
GrabRifqi FahmiProblem & solution
Grab’s passenger Android monorepo contains roughly 2,000 modules and 11 million lines of code, making Gradle-based Android Studio syncs increasingly slow and memory-intensive even though Bazel handles builds. A cold full sync could exceed 35 minutes, and a survey of 55 developers found that 82% wanted an option to exclude modules from syncing. The team built a custom Focus plugin that uses a dependency graph generated during migrateToBazel, avoids repeating Gradle’s configuration phase, and integrates with Android Studio through a one-click Select → Focus → Sync flow; a Groovy include-shadow technique avoids requiring teams to reorganize settings files. Typical focused syncs fell below two minutes, while reported results show reductions from 35 minutes to under one minute depending on module size, memory usage from 10 GB to 2 GB, and improved Compose preview updates, with broader IDE operations requiring expanded focus or full sync.
The passenger Android monorepo had roughly 2,000 modules and 11,000,000 lines of code. Android Studio continued using Gradle sync to build its project model, so a full sync configured every module regardless of the developer’s task. Cold syncs could take more than 35 minutes, consume substantial memory, and recur after rebases or branch checkouts. A survey found that 76% of respondents said long syncs significantly affected productivity and 82% wanted an option to exclude modules.
A custom Focus plugin limits Android Studio syncs to a selected module and its dependencies. Instead of recalculating the dependency graph during each focus operation, the team generates a JSON graph during migrateToBazel and reuses it for fast local lookups. A Groovy include-shadow technique avoids moving module declarations or changing feature-team workflows, while an Android Studio plugin provides module selection, health indicators, and one-click synchronization.
The dependency graph is generated during migrateToBazel, eliminating the Gradle configuration phase from focus operations; developers must rerun migrateToBazel after adding modules or changing dependencies.
Focus mode reduced reported IDE memory consumption from 10 GB to 2 GB and reduced sync time from 35 minutes to under 1 minute, depending on module size.
Find Usages and cross-module refactoring cover only focused modules, so repo-wide work may require expanding the focus set or temporarily using a full sync.
Summaries are generated from the original by a language model. Check the original before relying on it.
See the idea
See how Bazel’s dependency graph can separate build scope from IDE scope, helping engineers move through large monorepos without syncing every module.
Keep reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
One useful email. Unsubscribe anytime.