规模化开发者体验:我们如何在大型 monorepo 中改进 Android Studio
Introduction
简介
Long integrated development environment (IDE) sync/indexing times can quietly erode developer productivity, making code navigation sluggish, spiking memory usage, and slowing down Jetpack Compose preview updates, turning the IDE into a bottleneck rather than a helpful tool. For Android engineers working in a large monorepo, this was a daily reality. In this post, we will share how we built a custom Focus plugin that dramatically reduced Android Studio sync times by leveraging our existing investments, such as the Gradle-to-Bazel migration workflow.
漫长的集成开发环境(IDE)同步/索引时间会在不知不觉中侵蚀开发者的生产力,导致代码导航迟缓、内存使用量激增,并拖慢Jetpack Compose预览更新速度,使IDE从得力助手变成了瓶颈。对于在大型monorepo中工作的Android工程师来说,这是每天都在面对的现实。在这篇文章中,我们将分享如何构建一个自定义的Focus插件,通过利用我们现有的投资(如Gradle到Bazel的迁移工作流),大幅缩短Android Studio的同步时间。
Our Android monorepo at scale
我们大规模的 Android monorepo
The Grab passenger Android (PAX) repository contains roughly 2,000 Android modules and 11,000,000 lines of code. As the repository grows year over year, a natural consequence of scaling our superapp, which combines ride-hailing, food delivery, payments, and more into a single application, is the increase in time required to build and sync the project.
Grab 乘客端 Android (PAX) 代码库包含大约 2,000 个 Android 模块和 11,000,000 行代码。随着代码库逐年增长,扩展我们的超级应用(将网约车、外卖、支付等功能整合到一个应用中)的一个自然结果就是构建和同步项目所需时间的增加。
What makes this growth especially pronounced today is the shift in how code gets written. Development assisted by artificial intelligence (AI) has enabled engineers to produce more code faster than before. At the same time, non-engineering personnel such as designers, product managers, and other non-technical contributors have started making changes to low-risk features under engineering provision. Together, these two forces are pushing the codebase to grow at its fastest rate ever, which in turn compounds the pressure on every developer’s IDE and build tooling to keep up.
如今,这种增长之所以尤为显著,是因为代码编写方式发生了转变。人工智能(AI)辅助开发使工程师能够比以往更快地编写更多代码。同时,设计师、产品经理和其他非技术贡献者等非工程人员也开始在工程支持下对低风险功能进行更改。这两股力量共同推动代码库以有史以来最快的速度增长,...