reworked dependency layout

This commit is contained in:
Paul Fey 2025-07-05 13:52:37 +02:00
parent ac2f7c95e1
commit fd319dc470
2 changed files with 19 additions and 9 deletions

View file

@ -72,15 +72,20 @@ def build(path: str, output: str | None, should_compress: bool, compile_static:
os.chdir(src_directory) os.chdir(src_directory)
package_dependencies = {}
if "dependencies" in information: if "dependencies" in information:
if "build_packages" in information["dependencies"]: if "build" in information["dependencies"]:
for package in information["dependencies"]["build_packages"]: if "packages" in information["dependencies"]["build"]:
if not package in []: for package in information["dependencies"]["build"]["packages"]:
fail(f"The boundaries package {package} could not be found and is a build dependency") if not package in []:
if "build_commands" in information["dependencies"]: fail(f"The rodeo package {package} could not be found or is not loaded.")
for command in information["dependencies"]["build_commands"]: if "commands" in information["dependencies"]["build"]:
if shutil.which(command) is None: for command in information["dependencies"]["build"]["commands"]:
fail(f"The command {command} could not be found and is a build dependency") if shutil.which(command) is None:
fail(f"The command {command} could not be found and is a build dependency")
if "runtime" in information["dependencies"]:
package_dependencies = information["dependencies"]["runtime"]
if "web_sources" in information and isinstance(information["web_sources"], dict) and len(information["web_sources"]) > 0: if "web_sources" in information and isinstance(information["web_sources"], dict) and len(information["web_sources"]) > 0:
for org_url, org_path in information["web_sources"].items(): for org_url, org_path in information["web_sources"].items():
@ -121,6 +126,8 @@ def build(path: str, output: str | None, should_compress: bool, compile_static:
json_file["name"] = information["name"] json_file["name"] = information["name"]
json_file["version"] = information["version"] json_file["version"] = information["version"]
json_file["dependencies"] = package_dependencies
with open("rodeo-package.json", "wt") as f: with open("rodeo-package.json", "wt") as f:
json.dump(json_file, f) json.dump(json_file, f)

View file

@ -4,6 +4,9 @@
"version": "0.1", "version": "0.1",
"build": "bash build.sh", "build": "bash build.sh",
"dependencies": { "dependencies": {
"build_commands": ["pip"] "build": { "commands": ["pip"] },
"runtime": {
"python": "*"
}
} }
} }