Intro
Bazel is still in its early days as a build system for Android, but support for building Android apps exists and Google uses Bazel (previously Blaze) for building many of its apps. Google claims Bazel is a lot faster for incremental builds for large apps, which is a good enough reason for me to give it a try, considering how slow Gradle can be.
If you want to try out Bazel for building your app, you should know that there's no need to give up on Gradle. It's possible to use both Gradle and Bazel to build the same project. The rest of this will be a guide for how you can create Bazel build files similar to your build.gradle files so that you can build your project with both Gradle and Bazel. You may want to do this so that you can gradually switch over to using Bazel, or so you can always have something to fall back to in case something goes wrong with your Bazel build. It's also likely that if you have a complex enough project, that you'll be using features of Gradle which aren't built in to Bazel, but it may prove to be a reasonable alternative to use during development.
To follow along with this guide, you'll need to get Bazel setup on your machine. I recommend following the instructions at bazel.io/docs/install. After setting up, go through the tutorial on how to build an Android app. The tutorial only covers how to make a basic app, with no reference to Gradle, but if you're able to build it, that should mean that you have everything you need to follow this guide.
BINABASA MO ANG
Building Android Apps: Moving from Gradle to Bazel
Non-FictionBazel is a new build system developed by Google which allows for an alternative to Gradle for building Android apps. In this guide, I'll show you how you can use Bazel to build your existing Gradle-based Android app.
