From cf6f6f9ef7dd0755148652a14b2bb3061aae35f1 Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Fri, 1 Jun 2018 15:37:35 -0400 Subject: [PATCH] README files for Android SDK and mentat_ffi --- ffi/README.md | 22 ++++++++++++++++++++++ sdks/android/README.md | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 ffi/README.md create mode 100644 sdks/android/README.md diff --git a/ffi/README.md b/ffi/README.md new file mode 100644 index 00000000..db3153d6 --- /dev/null +++ b/ffi/README.md @@ -0,0 +1,22 @@ +# Development flow for Mentat FFI + +## Android SDK +Android Mentat SDK is one of two first-party consumers (the other one being iOS Mentat SDK). + +Binaries produced by `cargo build ...` are symlinked from within the SDK, and a number of target-specific `libmentat_ffi.so` binaries are bundled together and distributed with the SDK. + +There is a build script at `/scripts/android_build.sh` which knows how to cross-compile `mentat_ffi` for various Android targets. + +- `.//scripts/android_build.sh` - compiles for all supported targets +- `.//scripts/android_build.sh x86` - compiles for `x86` +- `.//scripts/android_build.sh x86 arm` - compiles for `x86`, `arm` + +General development flow while working on the Android SDK is: +- (pre) compile for all targets, if you've never done so +- make changes to `mentat_ffi` and/or `mentat` +- re-compile `mentat_ffi` binaries using `./android_build.sh x86`. During development it's faster to compile just for the target which matches your emulator, e.g. `x86` +- make corresponding changes in the Android SDK, try them out from within the bundled sample project +- since binaries are symlinked, no manual copy step is necessary for the Android SDK to pick up the changes + +## iOS SDK +TODO, contribute via [issue #732](https://github.com/mozilla/mentat/issues/732). diff --git a/sdks/android/README.md b/sdks/android/README.md new file mode 100644 index 00000000..5ed440b1 --- /dev/null +++ b/sdks/android/README.md @@ -0,0 +1,8 @@ +# Android Mentat SDK + +Exposes Mentat functionality to Android applications via the foreign function interface provided by `mentat_ffi`. + +Note that `libmentat_ffi.so` binaries are symlinked. Use [the cross-compilation script](https://github.com/mozilla/mentat/tree/master/scripts/android_build.sh) to build them. Windows users: apologies if you're on FAT; symlinks are supported on NTFS (on Vista and later). + +- See [sample projects](https://github.com/mozilla/mentat/tree/master/sdks/android/Mentat/samples) for how one might use the SDK. +- See [documentation](https://github.com/mozilla/mentat/tree/master/ffi/README.md) within the `mentat_ffi` crate for development flow.