mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
fbt: dist improvements (#3186)
* fbt: MENUEXTERNAL apps now respect build configuration; fixed `fap_deploy` * fbt, ufbt: better message for missing app manifests (shows real paths) Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
0131eb3aa2
commit
0d94abf856
3 changed files with 20 additions and 10 deletions
|
@ -185,6 +185,7 @@ fap_deploy = distenv.PhonyTarget(
|
||||||
],
|
],
|
||||||
source=firmware_env.Dir(("${RESOURCES_ROOT}/apps")),
|
source=firmware_env.Dir(("${RESOURCES_ROOT}/apps")),
|
||||||
)
|
)
|
||||||
|
Depends(fap_deploy, firmware_env["FW_RESOURCES_MANIFEST"])
|
||||||
|
|
||||||
|
|
||||||
# Target for bundling core2 package for qFlipper
|
# Target for bundling core2 package for qFlipper
|
||||||
|
|
|
@ -240,12 +240,12 @@ class AppBuildset:
|
||||||
FlipperAppType.SETTINGS,
|
FlipperAppType.SETTINGS,
|
||||||
FlipperAppType.STARTUP,
|
FlipperAppType.STARTUP,
|
||||||
)
|
)
|
||||||
EXTERNAL_APP_TYPES = (
|
EXTERNAL_APP_TYPES_MAP = {
|
||||||
FlipperAppType.EXTERNAL,
|
FlipperAppType.EXTERNAL: True,
|
||||||
FlipperAppType.MENUEXTERNAL,
|
FlipperAppType.PLUGIN: True,
|
||||||
FlipperAppType.PLUGIN,
|
FlipperAppType.DEBUG: True,
|
||||||
FlipperAppType.DEBUG,
|
FlipperAppType.MENUEXTERNAL: False,
|
||||||
)
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def print_writer(message):
|
def print_writer(message):
|
||||||
|
@ -318,8 +318,8 @@ class AppBuildset:
|
||||||
def _process_ext_apps(self):
|
def _process_ext_apps(self):
|
||||||
extapps = [
|
extapps = [
|
||||||
app
|
app
|
||||||
for apptype in self.EXTERNAL_APP_TYPES
|
for (apptype, global_lookup) in self.EXTERNAL_APP_TYPES_MAP.items()
|
||||||
for app in self.get_apps_of_type(apptype, True)
|
for app in self.get_apps_of_type(apptype, global_lookup)
|
||||||
]
|
]
|
||||||
extapps.extend(map(self.appmgr.get, self._extra_ext_appnames))
|
extapps.extend(map(self.appmgr.get, self._extra_ext_appnames))
|
||||||
|
|
||||||
|
@ -407,10 +407,14 @@ class AppBuildset:
|
||||||
return sdk_headers
|
return sdk_headers
|
||||||
|
|
||||||
def get_apps_of_type(self, apptype: FlipperAppType, all_known: bool = False):
|
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(
|
return sorted(
|
||||||
filter(
|
filter(
|
||||||
lambda app: app.apptype == apptype,
|
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,
|
key=lambda app: app.order,
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,8 +21,13 @@ def LoadAppManifest(env, entry):
|
||||||
APP_MANIFEST_NAME = "application.fam"
|
APP_MANIFEST_NAME = "application.fam"
|
||||||
manifest_glob = entry.glob(APP_MANIFEST_NAME)
|
manifest_glob = entry.glob(APP_MANIFEST_NAME)
|
||||||
if len(manifest_glob) == 0:
|
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(
|
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
|
app_manifest_file_path = manifest_glob[0].rfile().abspath
|
||||||
|
|
Loading…
Reference in a new issue