<#18351 Add support to refer to a group of targets...
# github-notifications
q
#18351 Add support to refer to a group of targets in BUILD files Issue created by AlexTereshenkov Is your feature request related to a problem? Please describe. Imagine there is a directory containing a number of nested directories each containing JSON files. There's a
file
target in the
BUILD
file in each directory. I'd like to produce a package, say, an
archive
, that will include all files in the current directory, and all the subdirectories, recursively:
Copy code
archive(name="main-archive", format="tar", files=["helloworld::"])
that's illegal
Copy code
UnsupportedWildcardError: The address `helloworld::` from the `files` from the target //:main-archive 
ended in a wildcard (`::`), which is not supported.
I wonder if it would be helpful to have a way to say "include all targets in a directory, recursively"? Describe the solution you'd like To be able to refer to a group of targets in the repository without specifying their paths explicitly. Describe alternatives you've considered I could do a
list
/
peek
and get all the targets of a particular type to be placed into the
dependencies
field once. However, I'd need to update that list every time a new directory with a JSON file is added. Having a target
files(sources=["**/*/*.json"])
does the trick so you can depend on a single target, however, that's too coarse-grained; having both
file
target in the subdirectory and all-covering
files
leads to duplicate ownership which is not ideal either. pantsbuild/pants