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

[FL-3317] fbt: allow strings for fap_version field in app manifests (#2672)

This commit is contained in:
hedger
2023-05-14 14:49:52 +03:00
committed by GitHub
parent c496962f95
commit 8d1f5b04b3
4 changed files with 14 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ class FlipperApplication:
# .fap-specific
sources: List[str] = field(default_factory=lambda: ["*.c*"])
fap_version: Tuple[int] = field(default_factory=lambda: (0, 1))
fap_version: str | Tuple[int] = "0.1"
fap_icon: Optional[str] = None
fap_libs: List[str] = field(default_factory=list)
fap_category: str = ""
@@ -84,6 +84,13 @@ class FlipperApplication:
def __post_init__(self):
if self.apptype == FlipperAppType.PLUGIN:
self.stack_size = 0
if isinstance(self.fap_version, str):
try:
self.fap_version = tuple(int(v) for v in self.fap_version.split("."))
except ValueError:
raise FlipperManifestException(
f"Invalid version string '{self.fap_version}'. Must be in the form 'major.minor'"
)
class AppManager: