fbt: add fap_deploy target to build and copy all .fap apps to flipper (#2146)

* fbt: add `faps_copy` target to build and copy all .fap apps to flipper
* fbt: restore default runfap.py invocation behavior, use -n for copy only
* fbt: proper implementation of fap_deploy target

Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
Stephen Kent
2023-01-11 02:13:07 -08:00
committed by GitHub
parent 8d2143add5
commit d2df35a35b
4 changed files with 39 additions and 7 deletions

View File

@@ -11,6 +11,8 @@ Building:
Build all FAP apps
fap_{APPID}, launch_app APPSRC={APPID}:
Build FAP app with appid={APPID}; upload & start it over USB
fap_deploy:
Build and upload all FAP apps over USB
Flashing & debugging:
flash, flash_blackmagic, jflash:

View File

@@ -15,6 +15,13 @@ import serial.tools.list_ports as list_ports
class Main(App):
def init(self):
self.parser.add_argument("-p", "--port", help="CDC Port", default="auto")
self.parser.add_argument(
"-n",
"--no-launch",
dest="launch_app",
action="store_false",
help="Don't launch app",
)
self.parser.add_argument("fap_src_path", help="App file to upload")
self.parser.add_argument(
@@ -84,11 +91,14 @@ class Main(App):
self.logger.error(f"Error: upload failed: {storage.last_error}")
return -3
storage.send_and_wait_eol(f'loader open "Applications" {fap_dst_path}\r')
result = storage.read.until(storage.CLI_EOL)
if len(result):
self.logger.error(f"Unexpected response: {result.decode('ascii')}")
return -4
if self.args.launch_app:
storage.send_and_wait_eol(
f'loader open "Applications" {fap_dst_path}\r'
)
result = storage.read.until(storage.CLI_EOL)
if len(result):
self.logger.error(f"Unexpected response: {result.decode('ascii')}")
return -4
return 0
finally: