mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 12:51:22 +04:00
[FL-3629] fbt: reworked assets & resources handling (#3160)
* fbt: reworking targets & assets handling WIP * fbt: dist fixes * fbt: moved SD card resources to owning apps * unit_tests: moved resources to app folder * github: updated unit_tests paths * github: packaging fixes * unit_tests: fixes * fbt: assets: internal cleanup * fbt: reworked assets handling * github: unit_tests: reintroducing fixes * minor cleanup * fbt: naming changes to reflect private nature of scons tools * fbt: resources: fixed dist archive paths * docs: updated paths * docs: updated more paths * docs: included "resources" parameter in app manifest docs; updated assets readme * updated gitignore for assets * github: updated action versions * unit_tests: restored timeout; scripts: assets: logging changes * gh: don't upload desktop animations for unit test run Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from flipper.app import App
|
||||
from flipper.assets.icon import file2image
|
||||
@@ -220,6 +221,7 @@ class Main(App):
|
||||
if not os.path.isdir(directory_path):
|
||||
self.logger.error(f'"{directory_path}" is not a directory')
|
||||
exit(255)
|
||||
|
||||
manifest_file = os.path.join(directory_path, "Manifest")
|
||||
old_manifest = Manifest()
|
||||
if os.path.exists(manifest_file):
|
||||
@@ -234,13 +236,15 @@ class Main(App):
|
||||
self.logger.info("Comparing new manifest with existing")
|
||||
only_in_old, changed, only_in_new = Manifest.compare(old_manifest, new_manifest)
|
||||
for record in only_in_old:
|
||||
self.logger.info(f"Only in old: {record}")
|
||||
self.logger.debug(f"Only in old: {record}")
|
||||
for record in changed:
|
||||
self.logger.info(f"Changed: {record}")
|
||||
for record in only_in_new:
|
||||
self.logger.info(f"Only in new: {record}")
|
||||
self.logger.debug(f"Only in new: {record}")
|
||||
if any((only_in_old, changed, only_in_new)):
|
||||
self.logger.warning("Manifests are different, updating")
|
||||
self.logger.info(
|
||||
f"Manifest updated ({len(only_in_new)} new, {len(only_in_old)} removed, {len(changed)} changed)"
|
||||
)
|
||||
new_manifest.save(manifest_file)
|
||||
else:
|
||||
self.logger.info("Manifest is up-to-date!")
|
||||
|
||||
Reference in New Issue
Block a user