BUILD
file. Bazel uses those statements to create the project’s dependency graph,
which enables accurate incremental builds.
To visualize the sample project’s dependencies, you can generate a text
representation of the dependency graph by running this command at the
workspace root:
//main:hello-world (excluding host and implicit dependencies) and format the
output as a graph.
Then, paste the text into GraphViz.
On Ubuntu, you can view the graph locally by installing GraphViz and the xdot
Dot Viewer:
Figure 1. Dependency graph for hello-world displays a single target with a single
source file.
After you set up your workspace, build your project, and examine its
dependencies, then you can add some complexity.