https://pantsbuild.org/ logo
#general
Title
# general
f

fresh-cat-90827

02/14/2023, 5:39 PM
never had to do it before, but can one specify in the dependencies of a target that it depends on all targets in the subtree, recursively? ๐Ÿงต
say there is a directory containing a number of nested directories each containing a JSON file. There's a
file
target in the BUILD file in each directory. I'd like to produce a package, say, `archive`:
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.
Is there a way to say "include all targets in a directory, recursively"? 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
files(sources=["**/*/*"]
does the trick so you can depend on a single target, however, that's too coarse-grained; having both
file
in the subdirectory and all-covering
files
leads to duplicate ownership, not ideal either
c

curved-television-6568

02/14/2023, 5:42 PM
Just noting this would be possible with https://github.com/pantsbuild/pants/discussions/18067 ๐Ÿ˜‰
๐Ÿ‘€ 1
4 Views