How do I make a target behave like `resource` in t...
# plugins
n
How do I make a target behave like
resource
in the sense that if Python code depends on it, the target’s source file is also bundled when the Python code is packaged as a PEX? Adding a
BuiltPackage
rule for the target is the closest thing to (what seems like) a solution I can find by just scrolling through existing backends, but unsure if that’s the right path. Those existing backends seem to all have a need to do something with the file before packaging it, which I don’t.
1
b
From a plugin, you'd want to make a codegen rule that generates a
ResourceSourceField
🙌 1
From a
BUILD
you can try
experimental_wrap_as_resources
from 2.16.x
n
Codegen rule it is. Thanks!