Automating and verifyingDocumentation Index
Fetch the complete documentation index at: https://docs.aspect.build/llms.txt
Use this file to discover all available pages before exploring further.
BUILD file generation is a key part of Bazel development. Tools like Gazelle and Aspect Workflows help developers keep BUILD files up-to-date and consistent with project source code.
Automated BUILD file management with Gazelle
ManagingBUILD files in Bazel is essential. You must add these files to the source code repository and they must accurately reflect the project’s source code. Maintaining these files manually can be tedious and error-prone. For instance, import statements in the code must match the entries in the deps attribute of *_library targets.
This concept explains how Gazelle and its integration with Aspect Workflows handle this maintenance.
What’s Gazelle?
Gazelle is a widely used tool for generating and updatingBUILD files automatically.
- Initially popular for Go projects.
- Now supports many other languages.
- Using Gazelle ensures
BUILDfiles stay consistent with your source code.
Integration with Aspect Workflows
Aspect Workflows automatesBUILD file generation and verification using Gazelle. To keep BUILD files current, use the gazelle task in the Workflows configuration.

