1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +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:
hedger
2023-10-30 19:17:30 +04:00
committed by GitHub
parent 176fb21f5f
commit 917410a0a8
345 changed files with 466 additions and 394 deletions

View File

@@ -64,6 +64,7 @@ class FlipperApplication:
order: int = 0
sdk_headers: List[str] = field(default_factory=list)
targets: List[str] = field(default_factory=lambda: ["all"])
resources: Optional[str] = None
# .fap-specific
sources: List[str] = field(default_factory=lambda: ["*.c*"])
@@ -272,11 +273,15 @@ class AppBuildset:
self._check_unsatisfied() # unneeded?
self._check_target_match()
self._group_plugins()
self.apps = sorted(
self._apps = sorted(
list(map(self.appmgr.get, self.appnames)),
key=lambda app: app.appid,
)
@property
def apps(self):
return list(self._apps)
def _is_missing_dep(self, dep_name: str):
return dep_name not in self.appnames
@@ -385,13 +390,13 @@ class AppBuildset:
def get_apps_cdefs(self):
cdefs = set()
for app in self.apps:
for app in self._apps:
cdefs.update(app.cdefines)
return sorted(list(cdefs))
def get_sdk_headers(self):
sdk_headers = []
for app in self.apps:
for app in self._apps:
sdk_headers.extend(
[
src._appdir.File(header)
@@ -405,14 +410,14 @@ class AppBuildset:
return sorted(
filter(
lambda app: app.apptype == apptype,
self.appmgr.known_apps.values() if all_known else self.apps,
self.appmgr.known_apps.values() if all_known else self._apps,
),
key=lambda app: app.order,
)
def get_builtin_apps(self):
return list(
filter(lambda app: app.apptype in self.BUILTIN_APP_TYPES, self.apps)
filter(lambda app: app.apptype in self.BUILTIN_APP_TYPES, self._apps)
)
def get_builtin_app_folders(self):