Is it possible to create more than one `resources`...
# general
n
Is it possible to create more than one
resources
using a macro? The thing is... In each package within my monorepo, I'm defining two exactly the same resources, like this:
Copy code
resources(
    name = "py.typed",
    sources = ["py.typed"],
)

resources(
    name = "VERSION",
    sources = ["VERSION"],
)
It would be nice if I can simplify this to something like this:
Copy code
my_standard_resources()
h
Hey Zdeněk! It should be. From https://www.pantsbuild.org/docs/macros#how-to-add-a-macro
A macro can create multiple targets:
Copy code
def python23_tests(name, **kwargs):
    kwargs.pop("interpreter_constraints", None)

    python_tests(
        name=f"{name}_py2",
        interpreter_constraints=["==2.7.*"],
        **kwargs,
    )
 
    python_tests(
        name=f"{name}_py3",
        interpreter_constraints=[">=3.5"],
        **kwargs,
    )
n
Ok, great! I will give it a try.
❤️ 1
Awesome. This allowed me to simplify the main BUILD files of the packages a lot.
💯 1