When building macros, is there an idiomatic way of...
# general
l
When building macros, is there an idiomatic way of listing all the target names that the macro created? I’m trying to create a macro that will define a bunch of
system-binary
dependencies to be used by other targets and would like to simply add them as a group to an
adhoc_tool
runnable dependencies.
e
Does the macro just get applied in 1 place / 1 call? If so it has the full list of deps and can plop out an additional target target that depends on the full list: https://www.pantsbuild.org/docs/reference-target
l
The idea is to have it applied once per project in the monorepo. I think
target
would work but since it is a generic target I can’t use it as a dependency in runnables_dependencies. I get the error:
Copy code
ValueError: Address `node:deps` was specified as a runnable dependency, but is not
runnable.
e
Ah, ok. We used to have an
alias
target for that sort of thing IIRC that got inlined / expanded and so was transparent, but no more.
l
That would have been great. Or if I could somehow specify what kind of target
target
is
For now I’m defining a constant in the macro as a tuple with all the individual dependencies and using that in the BUILD file. Not ideal but works 😕