I have a use case, that for the deps of a target, i need to depend on all targets of another BUILD file. that BUILD file has about 100 targets so it's not realistic for me to write down all of them, is there a quicker way to specify the dependencies?
You could create a macro that loops through all existing rules in a BUILD file and creates a filegroup for it. The other BUILD file would depend on this filegroup.
The bazel docs have a stub example that finds all cc_library rules and aggregates them together.
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