quaint-telephone-89068
02/24/2023, 6:24 AMfile 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:
archive(name="main-archive", format="tar", files=["helloworld::"])
that's illegal
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