https://pantsbuild.org/ logo
n

narrow-vegetable-37489

05/11/2023, 3:39 PM
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

bitter-ability-32190

05/11/2023, 3:39 PM
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

narrow-vegetable-37489

05/11/2023, 3:43 PM
Codegen rule it is. Thanks!