Is there a way to instruct bazel to list all the targets it has found without building or testing them?
bazel query
can be used to discover targets within a bazel workspace (without building / testing them)
For example;
To find all labels in a given package:
bazel query //some/package:*
If only interested in rules, then:
bazel query 'kind(.*rule, //some/package:*)'
//some/package:*
could be substituted for any valid label expression, eg including all descending packages, //some/package/...
The bazel query docs show further functions that could be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With