How to create a target base depends on all targets inside another BUILD file

I have a use case that for deputies, I have to depend on all the targets of another BUILD file. that the BUILD file has about 100 targets, so it is not realistic for me to write down all of them, is there a faster way to specify the dependencies?

+3


source to share


1 answer


You can create a macro that will go through all the existing rules in the BUILD file and create a filegroup for it. Another BUILD file will depend on this filegroup.



bazel docs has a stub example that finds all cc_library rules and concatenates them together.

+5


source







All Articles