Bazel on Android: The Good, The Bad and The Ugly
summary
Slack migrates Android builds to Bazel, builds the full app target and runs 45,000+ unit tests in CI, and measures ~70% faster test result times in CI with a p50 unit-test config under three minutes versus Gradle’s ~11–12 minutes. Migration uses rules_java/rules_kotlin/rules_android, rules_jvm_external, custom SQLDelight codegen, emulatorWTF for instrumentation, and a sync pipeline (Aaron plugin then a Bulldozer-backed Python script that syncs in ~3 seconds). It works for hermetic CI caching but fails to deliver acceptable local IDE experience and incremental compilation is slower, so rollout stalls.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 1:08Considering Bazel for Android
- 3:34Gradle configuration pain
- 5:18Modularization and Bazel appeal
- 6:42Slack’s build goals
- 7:45Bazel without disrupting Gradle
- 8:46Gradle plugins and Bazel rules
- 11:58Replacing Gradle plugins
- 13:04External APIs and tool invocations
- 14:47Community rules challenges
- 15:29Migration progress
- 16:51Developer testing handoff
- 17:57Bazel to main branch
- 19:19CI builds and sync tools
- 20:20Gradle to Bazel sync
- 21:45Developer feedback and rollback
- 22:49PR-based Bazel workflow
- 24:11Bazel testing quirks
- 24:53Instrumentation tests issues
- 26:21Test runner limitations
- 27:45Hermetic builds benefits
- 28:48Bazel vs Gradle performance
- 31:14IDE integration challenges
- 33:41JetBrains H Garden support
- 34:22Developer preview feedback
- 36:07Pausing Bazel project
- 36:5015-month journey reflections
- 37:11Good, bad, and ugly of Bazel
- 39:39Incremental compilation limits
- 40:22Would we do it again
related talks
48mBazel for Android Development
43mBoosting Bazel adoption on Android with automation
42mBazel
17mGrazel - A Gradle plugin to automate Bazel migration for Android projects
39mAutomated migration of Android apps to Bazel build system
01h 12mBazel for Android Developers
41mDo You Need Bazel in Android Development?
23mWalk, Run, Fly - Take your build pipeline to the next level!
