bazel__book/packages.md

14 lines
546 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Packages
Packages are how BZL organizes code.
- A package is a directory container a `BUILD[.bazel]` file.
- The `BUILD.bazel` defines targets in the package:
- libraries
- binaries
- tests
- Targets can depend on other targets in the same package or other packages.
- Visibility can be widened to the subtree or the entiry repository, but
like in Go it is best to start with the smallest possible scope.
- They are visible only within the package by default
- Targets flagged `testonly` can only be used by test targets.