Merge branch 'ofw_dev' into nfcrefactoring

This commit is contained in:
MX
2023-11-08 15:14:30 +04:00
6 changed files with 49 additions and 20 deletions
+13 -9
View File
@@ -240,12 +240,12 @@ class AppBuildset:
FlipperAppType.SETTINGS,
FlipperAppType.STARTUP,
)
EXTERNAL_APP_TYPES = (
FlipperAppType.EXTERNAL,
FlipperAppType.MENUEXTERNAL,
FlipperAppType.PLUGIN,
FlipperAppType.DEBUG,
)
EXTERNAL_APP_TYPES_MAP = {
FlipperAppType.EXTERNAL: True,
FlipperAppType.PLUGIN: True,
FlipperAppType.DEBUG: True,
FlipperAppType.MENUEXTERNAL: False,
}
@staticmethod
def print_writer(message):
@@ -318,8 +318,8 @@ class AppBuildset:
def _process_ext_apps(self):
extapps = [
app
for apptype in self.EXTERNAL_APP_TYPES
for app in self.get_apps_of_type(apptype, True)
for (apptype, global_lookup) in self.EXTERNAL_APP_TYPES_MAP.items()
for app in self.get_apps_of_type(apptype, global_lookup)
]
extapps.extend(map(self.appmgr.get, self._extra_ext_appnames))
@@ -407,10 +407,14 @@ class AppBuildset:
return sdk_headers
def get_apps_of_type(self, apptype: FlipperAppType, all_known: bool = False):
"""Looks up apps of given type in current app set. If all_known is true,
ignores app set and checks all loaded apps' manifests."""
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 map(self.appmgr.get, self.appnames),
),
key=lambda app: app.order,
)
+6 -1
View File
@@ -21,8 +21,13 @@ def LoadAppManifest(env, entry):
APP_MANIFEST_NAME = "application.fam"
manifest_glob = entry.glob(APP_MANIFEST_NAME)
if len(manifest_glob) == 0:
try:
disk_node = next(filter(lambda d: d.exists(), entry.get_all_rdirs()))
except Exception:
disk_node = entry
raise FlipperManifestException(
f"Folder {entry}: manifest {APP_MANIFEST_NAME} is missing"
f"App folder '{disk_node.abspath}': missing manifest ({APP_MANIFEST_NAME})"
)
app_manifest_file_path = manifest_glob[0].rfile().abspath
+1 -1
View File
@@ -53,7 +53,7 @@ class GitVersion:
)
else:
commit_date = datetime.strptime(
self._exec_git("log -1 --format=%cd").strip(),
self._exec_git("log -1 --format=%cd --date=default").strip(),
"%a %b %d %H:%M:%S %Y %z",
)