mirror of
https://github.com/selfxyz/self.git
synced 2026-02-08 05:15:19 -05:00
mopro-ffi
Thin wrapper around mopro-core, exposes UniFFI bindings to be used by rust-ios, etc.
Overview
TBD.
Development
Prerequisites
- Ensure you have Rust installed
- Add platform targets
rustup target add x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim - Install
uniffi-bindgenlocally withcargo install --bin uniffi-bindgen --path . - In order to locally run the bindings tests, you will need
- Kotlin:
kotlinc, the Kotlin command-line compiler.ktlint, the Kotlin linter used to format the generated bindings.- The Java Native Access JAR downloaded and its path
added to your
$CLASSPATHenvironment variable.
- Swift:
swiftandswiftc, the Swift command-line tools.- The Swift
Foundationpackage.
- Kotlin:
Platforms supported
Currently iOS is the main target, but Android will soon follow. PRs welcome.
Building
Run make to build debug and release static libraries for supported platforms.
Generate UniFFI bindings
The following command generates Swift bindings:
uniffi-bindgen generate src/mopro.udl --language swift --out-dir target/SwiftBindings
Test bindings
To test bindings:
cargo test --test test_generated_bindings
To test bindings in release mode without warning:
cargo test --test test_generated_bindings --release 2>/dev/null