polite-city-98343
03/03/2025, 10:09 PM.jar and call it from a python script.
I've got the java part built with deploy_jar , but there's no obvious way of combining resource or file or relocated_files to make it accessible from python.
Any tips or help would be appreciatedelegant-florist-94385
03/03/2025, 10:12 PMpolite-city-98343
03/04/2025, 2:30 AMpolite-city-98343
03/04/2025, 2:34 AMshell_command doesn't find the ".jar" file generated by deploy_jarpolite-city-98343
03/12/2025, 10:15 PMshell_command(
name="my-jar-file.command",
command="exit 0",
workdir="/src.jvm.com.my.namespace",
execution_dependencies=["src/jvm/com/my/namespace:target"],
output_files=["my-jar-file.jar"],
outputs_match_mode="at_least_one",
root_output_directory=".",
)
relocated_files(
name="my-jar-file.relocated",
files_targets=[":my-jar-file.command"],
src="",
dest="mypackage/mymodule",
)
experimental_wrap_as_resources(name="my-jar-file.bin", inputs=[":my-jar-file.relocated"])polite-city-98343
03/12/2025, 10:17 PMrelocated_files with the relative path within src/python to my python module.
Then I could resolve the file path, and execute java with
with importlib.resources.as_file(importlib.resources.files(__name__) / "my-jar-file.jar") as my_jar_file:
sh.java("-jar", my_jar_file, ....)