gorgeous-winter-99296
07/26/2023, 9:34 AMpackage
support for adhoc_tool
? Doesn't seem to exist in 2.16 or 2.17 at least, and nothing on GitHub matches. It seems like one can ish get that to work with experimental_wrap_as_resources
+ export-codegen
but it seems a bit roundabout.gorgeous-winter-99296
07/26/2023, 10:21 AMadhoc_package
? As I think goals cannot conditionally apply on target (i.e., adhoc_tool is packageable iff...).broad-processor-92400
07/26/2023, 11:06 AMarchive
sort of works as a workaround for this purpose, although isn’t perfect (eg if outputting the files directly is what’s wanted, rather than zipping them up)
https://github.com/pantsbuild/pants/issues/17729 is somewhat relatedgorgeous-winter-99296
07/26/2023, 11:22 AMrelocated_files
in that case. And I still need experimental_wrap_as_resources
to put them into a pex for dev workflows.gorgeous-winter-99296
07/26/2023, 11:26 AMadhoc_tool(
name="build",
runnable=":bin",
args=["generate", "content"],
execution_dependencies=["//content:files", "//templates:files"],
output_directories=["public"],
timeout=300,
workdir="/",
)
relocated_files(
name="rooted",
files_targets=[":build"],
src="public",
dest="",
)
archive(
name="archive",
format="tar.gz",
files=[":rooted"],
)
experimental_wrap_as_resources(
name="site",
inputs=[":build"],
)
pex_binary(
name="serve",
entry_point="http.server",
args=["-d", "{chroot}/cmd/serve.pex/public"],
dependencies=[
":site",
],
execution_mode="venv",
layout="loose",
restartable=True,
)
broad-processor-92400
07/26/2023, 11:37 AMbroad-processor-92400
07/26/2023, 11:38 AMgorgeous-winter-99296
07/26/2023, 11:42 AM.md
files for an mdbook integration, f.ex. -- now that needs experimental_wrap_as_md
, but that's likely the md of my mdbook plugin... if someone else has a MarkdownSource type that is likely to be different. 🤯gorgeous-winter-99296
07/26/2023, 11:42 AMbitter-ability-32190
07/26/2023, 11:49 AMhappy-kitchen-89482
07/26/2023, 5:47 PMhappy-kitchen-89482
07/26/2023, 5:47 PMgorgeous-winter-99296
07/26/2023, 7:00 PMadhoc_tools
.happy-kitchen-89482
07/26/2023, 8:40 PM