1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

Merge branch 'dev' into hedger/toochain_29

This commit is contained in:
hedger
2024-02-16 11:33:18 +04:00
committed by GitHub
91 changed files with 3361 additions and 1739 deletions

View File

@@ -30,8 +30,11 @@ class HardwareTargetLoader:
if not target_json_file.exists():
raise Exception(f"Target file {target_json_file} does not exist")
with open(target_json_file.get_abspath(), "r") as f:
vals = json.load(f)
return vals
try:
vals = json.load(f)
return vals
except json.JSONDecodeError as e:
raise Exception(f"Failed to parse target file {target_json_file}: {e}")
def _processTargetDefinitions(self, target_id):
target_dir = self._getTargetDir(target_id)

View File

@@ -63,7 +63,13 @@ class Main(App):
return dist_target_path
def note_dist_component(self, component: str, extension: str, srcpath: str) -> None:
self._dist_components[f"{component}.{extension}"] = srcpath
component_key = f"{component}.{extension}"
if component_key in self._dist_components:
self.logger.debug(
f"Skipping duplicate component {component_key} in {srcpath}"
)
return
self._dist_components[component_key] = srcpath
def get_dist_file_name(self, dist_artifact_type: str, filetype: str) -> str:
return f"{self.DIST_FILE_PREFIX}{self.target}-{dist_artifact_type}-{self.args.suffix}.{filetype}"
@@ -162,8 +168,9 @@ class Main(App):
"scripts.dir",
)
sdk_bundle_path = self.get_dist_path(self.get_dist_file_name("sdk", "zip"))
with zipfile.ZipFile(
self.get_dist_path(self.get_dist_file_name("sdk", "zip")),
sdk_bundle_path,
"w",
zipfile.ZIP_DEFLATED,
) as zf:
@@ -205,6 +212,10 @@ class Main(App):
),
)
self.logger.info(
fg.boldgreen(f"SDK bundle can be found at:\n\t{sdk_bundle_path}")
)
def bundle_update_package(self):
self.logger.debug(
f"Generating update bundle with version {self.args.version} for {self.target}"