How to query bazel for the full list of generated files that have the extension .srcjar.zip?

Viewed 394

I'm working on a huge project with a huge bazel dependency graph.

When I run bazel build ..., I find lots of files in bazel-out/ with the extension .srcjar.zip, in addition to a million files I'm not interested in.

I'm trying to craft a bazel command that builds just these .srcjar.zip files.

I studied bazel queries but haven't found an example that demonstrates how to query for output files.

Thanks for your help!

1 Answers

I imagine some combination of the filter and kind query functions can accomplish this:

$ bazel query 'filter('.*\.srcjar\.zip$', kind("generated file", //...:*))'
Related