Using Bazel
Important message
This section will use Bazel. In order to download it, consider using Bazelisk since it will automatically update the Bazel version to the latest LTS release. You can find how to install Bazelisk here: https://bazel.build/install/bazelisk.
The last tool that I consider worth considering is Bazel. Unlike Makefiles and Buf, Bazel is a full-blown build system. As such, it requires more configuration, but it can build multiple languages, has efficient caching, and more. Once again, let’s try to run the sample project using this tool.
A modern Bazel project should start by adding a file called MODULE.bazel
at the root of the directory. This file contains the dependencies that are needed to build our project. In our case, we will need to have utilities to build Protobuf and Go. We will also need to have the dependency on Protobuf Go and to manage that we will use Gazelle (https://github.com/bazelbuild/bazel-gazelle). Our MODULE.bazel
looks like...