The https://github.com/bazelbuild/bazel-watcher project provides a wrapper for Bazel called ibazel
(short for “interactive Bazel”), which lets you keep the application running as you make changes. This can reduce the burden of interacting with Bazel while debugging a program or test. The example repository has this already set up in the tools
folder at tools/ibazel
.
ibazel
accepts most of the same command-line arguments as bazel
.
To try it, run:
% ./tools/ibazel run app:app_bin
Now make changes to the application, such as in the print
statement, and you should see that immediately appear in the terminal.
In this case, the program is restarted after each change. The 203 course covers how to keep it running as a daemon, which makes a faster devserver experience.