Skip to content

Commit

Permalink
Rename build outputs to include .fap extension
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dcoles committed Jan 14, 2023
1 parent 8c114be commit 2028353
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 13 deletions.
5 changes: 3 additions & 2 deletions examples/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions examples/dialog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["different-binary-name"]

[package]
name = "dialog"
version = "0.1.0"
Expand All @@ -10,6 +12,7 @@ autobenches = false

[[bin]]
name = "dialog"
filename = "dialog.fap"
bench = false
test = false

Expand Down
6 changes: 3 additions & 3 deletions examples/dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions examples/gpio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["different-binary-name"]

[package]
name = "gpio"
version = "0.1.0"
Expand All @@ -10,6 +12,7 @@ autobenches = false

[[bin]]
name = "gpio"
filename = "gpio.fap"
bench = false
test = false

Expand Down
2 changes: 1 addition & 1 deletion examples/gpio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
3 changes: 3 additions & 0 deletions examples/gui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["different-binary-name"]

[package]
name = "gui"
version = "0.1.0"
Expand All @@ -10,6 +12,7 @@ autobenches = false

[[bin]]
name = "gui"
filename = "gui.fap"
bench = false
test = false

Expand Down
6 changes: 3 additions & 3 deletions examples/gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions examples/hello-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["different-binary-name"]

[package]
name = "hello-rust"
version = "0.1.0"
Expand All @@ -10,6 +12,7 @@ autobenches = false

[[bin]]
name = "hello-rust"
filename = "hello-rust.fap"
bench = false
test = false

Expand Down
6 changes: 3 additions & 3 deletions examples/hello-rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions examples/notification/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["different-binary-name"]

[package]
name = "notification"
version = "0.1.0"
Expand All @@ -10,6 +12,7 @@ autobenches = false

[[bin]]
name = "notification"
filename = "notification.fap"
bench = false
test = false

Expand Down
2 changes: 1 addition & 1 deletion examples/notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 2028353

Please sign in to comment.