Skip to content

Commit

Permalink
rid-template: simplified bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed May 15, 2021
1 parent 65695bf commit eacf2f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 5 additions & 3 deletions rid-template-flutter/flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use the below scripts to get the app ready to run with Flutter.
### 1. Generate Glue Code

```sh
./sh/bindgen && ./sh/ffigen
./sh/bindgen
```

### 2. Build For Desired Target/Device
Expand Down Expand Up @@ -80,11 +80,13 @@ functionality currently provided by these scripts.
- `bindgen` generates the `binding.h` header file for the extern Rust functions found inside
`./src`. These are then placed inside the `./plugin` device folders were needed as well as
`./plugin/lib/generated/binding.h` where they are used to generate Dart glue code
- `ffigen` generates Dart glue code inside `./plugin/lib/generated/ffigen_binding.dart` using
`./plugin/lib/generated/binding.h` as input
- as part of this script `ffigen` generates Dart glue code inside
`./plugin/lib/generated/ffigen_binding.dart` using `./plugin/lib/generated/binding.h` as input
- `./android` builds the Rust binary to run on Android devices/emulators and places it inside
`./plugin/lib/android`
- `./ios` builds the Rust binary to run on IOS devices/emulators and places it inside
`./plugin/lib/ios`
- `./macos` builds the Rust binary to run on MacOs directly and places it inside
`./plugin/lib/macos`, this is the same format as running `cargo build` on your Mac
- `clean` cleans both the Flutter plugin and application, run this to reset Flutter when things
aren't working
3 changes: 2 additions & 1 deletion rid-template-flutter/sh/bindgen
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

(cd $DIR/.. && cargo run rid_build)
cd $DIR/.. && cargo run rid_build && \
cd $DIR/../plugin && flutter pub run ffigen --verbose severe
5 changes: 0 additions & 5 deletions rid-template-flutter/sh/ffigen

This file was deleted.

0 comments on commit eacf2f1

Please sign in to comment.