From 20283531b2f35a719865da7814f87565ae0a55c6 Mon Sep 17 00:00:00 2001 From: David Coles Date: Fri, 13 Jan 2023 23:13:11 -0800 Subject: [PATCH] Rename build outputs to include .fap extension This requires the `different-binary-name` feature that is only available in nightly, but we already require nightly for `alloc_error_handler`. Thanks to @ASoldo for discovering this! Closes: #36 --- examples/build.py | 5 +++-- examples/dialog/Cargo.toml | 3 +++ examples/dialog/README.md | 6 +++--- examples/gpio/Cargo.toml | 3 +++ examples/gpio/README.md | 2 +- examples/gui/Cargo.toml | 3 +++ examples/gui/README.md | 6 +++--- examples/hello-rust/Cargo.toml | 3 +++ examples/hello-rust/README.md | 6 +++--- examples/notification/Cargo.toml | 3 +++ examples/notification/README.md | 2 +- 11 files changed, 29 insertions(+), 13 deletions(-) diff --git a/examples/build.py b/examples/build.py index d98f2233..2e8eb716 100644 --- a/examples/build.py +++ b/examples/build.py @@ -34,8 +34,9 @@ def main(): if args.install: # Assume that the binary has the name as the - binary = path / 'target' / 'thumbv7em-none-eabihf' / 'release' / path.name - target = INSTALL_PATH / f'{path.name}.fap' + filename = f'{path.name}.fap' + binary = path / 'target' / 'thumbv7em-none-eabihf' / 'release' / filename + target = INSTALL_PATH / filename logging.info('Copying %s to %s', binary, target) run([PYTHON, STORAGE_SCRIPT, 'send', os.fspath(binary), os.fspath(target)], check=True) diff --git a/examples/dialog/Cargo.toml b/examples/dialog/Cargo.toml index 1cd23d6f..8219f3fe 100644 --- a/examples/dialog/Cargo.toml +++ b/examples/dialog/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["different-binary-name"] + [package] name = "dialog" version = "0.1.0" @@ -10,6 +12,7 @@ autobenches = false [[bin]] name = "dialog" +filename = "dialog.fap" bench = false test = false diff --git a/examples/dialog/README.md b/examples/dialog/README.md index a9c1fcfc..4d77d502 100644 --- a/examples/dialog/README.md +++ b/examples/dialog/README.md @@ -19,11 +19,11 @@ Demonstrates the high-level bindings to the Dialog API. 4. Copy to the Flipper Zero as a `.fap`: This can either be done using [qFlipper](https://flipperzero.one/update) or the [`flipperzero-firmware`](https://github.com/flipperdevices/flipperzero-firmware) scripts: ``` - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Misc - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/dialog /ext/apps/Misc/dialog.fap + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Examples + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/dialog.fap /ext/apps/Examples/dialog.fap ``` -After that you can launch the app on Flipper via `Menu → Applications → Misc → Rust dialog example`. +After that you can launch the app on Flipper via `Menu → Applications → Examples → Rust dialog example`. ## License diff --git a/examples/gpio/Cargo.toml b/examples/gpio/Cargo.toml index bb14ff89..92b06f39 100644 --- a/examples/gpio/Cargo.toml +++ b/examples/gpio/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["different-binary-name"] + [package] name = "gpio" version = "0.1.0" @@ -10,6 +12,7 @@ autobenches = false [[bin]] name = "gpio" +filename = "gpio.fap" bench = false test = false diff --git a/examples/gpio/README.md b/examples/gpio/README.md index 35d4f726..0184fcdd 100644 --- a/examples/gpio/README.md +++ b/examples/gpio/README.md @@ -29,7 +29,7 @@ cargo build --release This can either be done using [qFlipper](https://flipperzero.one/update) or the [`flipperzero-firmware`](https://github.com/flipperdevices/flipperzero-firmware) scripts: ``` ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Examples - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/gpio /ext/apps/Examples/gpio.fap + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/gpio.fap /ext/apps/Examples/gpio.fap ``` After that you can launch the app on Flipper via `Menu → Applications → Examples → Rust GPIO example`. diff --git a/examples/gui/Cargo.toml b/examples/gui/Cargo.toml index 9f7585f4..9ab6cb53 100644 --- a/examples/gui/Cargo.toml +++ b/examples/gui/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["different-binary-name"] + [package] name = "gui" version = "0.1.0" @@ -10,6 +12,7 @@ autobenches = false [[bin]] name = "gui" +filename = "gui.fap" bench = false test = false diff --git a/examples/gui/README.md b/examples/gui/README.md index 9f46105c..71e667dc 100644 --- a/examples/gui/README.md +++ b/examples/gui/README.md @@ -22,11 +22,11 @@ the `0.67` release and some Rust-specific fixes which are included in `0.68.1` r 4. Copy to the Flipper Zero as a `.fap`: This can either be done using [qFlipper](https://flipperzero.one/update) or the [`flipperzero-firmware`](https://github.com/flipperdevices/flipperzero-firmware) scripts: ``` - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Misc - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/hello-rust /ext/apps/Misc/hello-rust.fap + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Examples + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/gui.fap /ext/apps/Examples/gui.fap ``` -After that you can launch the app on Flipper via `Menu → Applications → Misc → Hello, Rust!`. +After that you can launch the app on Flipper via `Menu → Applications → Examples → Hello, Rust!`. ## License diff --git a/examples/hello-rust/Cargo.toml b/examples/hello-rust/Cargo.toml index a2c09d92..3635aa16 100644 --- a/examples/hello-rust/Cargo.toml +++ b/examples/hello-rust/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["different-binary-name"] + [package] name = "hello-rust" version = "0.1.0" @@ -10,6 +12,7 @@ autobenches = false [[bin]] name = "hello-rust" +filename = "hello-rust.fap" bench = false test = false diff --git a/examples/hello-rust/README.md b/examples/hello-rust/README.md index 7b394bd1..dc8f579d 100644 --- a/examples/hello-rust/README.md +++ b/examples/hello-rust/README.md @@ -33,11 +33,11 @@ the `0.67` release and some Rust-specific fixes which are included in `0.68.1` r 4. Copy to the Flipper Zero as a `.fap`: This can either be done using [qFlipper](https://flipperzero.one/update) or the [`flipperzero-firmware`](https://github.com/flipperdevices/flipperzero-firmware) scripts: ``` - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Misc - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/hello-rust /ext/apps/Misc/hello-rust.fap + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Examples + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/hello-rust.fap /ext/apps/Examples/hello-rust.fap ``` -After that you can launch the app on Flipper via `Menu → Applications → Misc → Hello, Rust!`. +After that you can launch the app on Flipper via `Menu → Applications → Examples → Hello, Rust!`. ## License diff --git a/examples/notification/Cargo.toml b/examples/notification/Cargo.toml index 7295f6cb..180ee6d6 100644 --- a/examples/notification/Cargo.toml +++ b/examples/notification/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["different-binary-name"] + [package] name = "notification" version = "0.1.0" @@ -10,6 +12,7 @@ autobenches = false [[bin]] name = "notification" +filename = "notification.fap" bench = false test = false diff --git a/examples/notification/README.md b/examples/notification/README.md index d2db91f4..3436044b 100644 --- a/examples/notification/README.md +++ b/examples/notification/README.md @@ -29,7 +29,7 @@ cargo build --release This can either be done using [qFlipper](https://flipperzero.one/update) or the [`flipperzero-firmware`](https://github.com/flipperdevices/flipperzero-firmware) scripts: ``` ${FLIPPERZERO_FIRMWARE}/scripts/storage.py mkdir /ext/apps/Examples - ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/notification /ext/apps/Examples/notification.fap + ${FLIPPERZERO_FIRMWARE}/scripts/storage.py send target/thumbv7em-none-eabihf/release/notification.fap /ext/apps/Examples/notification.fap ``` After that you can launch the app on Flipper via `Menu → Applications → Examples → Rust notification example`.