Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badboy/rocketscience
Example project to demonstrate what UniFFI can do
https://github.com/badboy/rocketscience
Last synced: 24 days ago
JSON representation
Example project to demonstrate what UniFFI can do
- Host: GitHub
- URL: https://github.com/badboy/rocketscience
- Owner: badboy
- License: mit
- Created: 2021-04-20T11:10:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T19:48:08.000Z (over 1 year ago)
- Last Synced: 2024-12-24T02:01:33.677Z (28 days ago)
- Language: C++
- Homepage:
- Size: 109 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# This is not rocket science‽
A project demonstrating how to use [UniFFI] to write a cross-platform Rust library and auto-generate bindings in different languages.
This project was used as an example at the [Rust Linz Meetup in April 2021](https://www.meetup.com/Rust-Linz/events/276521001/) during my talk "Leveraging Rust to build cross-platform mobile libraries".
It was updated to UniFFI 0.17 for my [Rust Nigeria Lightning Talk in February 2022](https://skillsmatter.com/meetups/13752-rust-nigeria-ama) titled "Rust in a UniFFIed World".## Tests
Tests are implemented in the respective languages. See [`tests/bindings/`](tests/bindings/) for a list of all implemented language bindings.
You can run all binding tests using `cargo`:
```
cargo xtask test
```Caution: This will require `swift`, `kotlinc` and `python3`.
If you want to run tests for only a single language you can do so:```
cargo xtask test kotlin
cargo xtask test swift
cargo xtask test python
```## Generate bindings code
When just testing all code is generated at build time.
If you want to generate the code for inspection,
to check it into source control or for other purposes
use [`uniffi_bindgen`].To install it:
```
cargo install uniffi_bindgen
```To generate the bindings in the `bindings/` directory:
```
cargo xtask generate
```## License
MIT. See [LICENSE](LICENSE).
Copyright (c) 2021-2022 Jan-Erik Rediger[uniffi]: https://github.com/mozilla/uniffi-rs
[`uniffi_bindgen`]: https://crates.io/crates/uniffi_bindgen