mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-19 00:04:25 +01:00
kotlin cross-arch build
This commit is contained in:
2
crypter-ffi/.gitignore
vendored
Normal file
2
crypter-ffi/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
notes.md
|
||||||
|
src/crypter.uniffi.rs
|
||||||
@@ -13,7 +13,6 @@ sphinx-key-crypter = { path = "../crypter" }
|
|||||||
uniffi = "0.19.2"
|
uniffi = "0.19.2"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
thiserror = "1.0.31"
|
thiserror = "1.0.31"
|
||||||
uniffi_macros = "0.19.2"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
uniffi_build = "0.19.2"
|
uniffi_build = "0.19.2"
|
||||||
|
|||||||
12
crypter-ffi/build-kotlin.sh
Executable file
12
crypter-ffi/build-kotlin.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
echo "=> creating kotlin bindings"
|
||||||
|
uniffi-bindgen generate src/crypter.udl --language kotlin
|
||||||
|
|
||||||
|
echo "=> creating C FFI scaffolding"
|
||||||
|
uniffi-bindgen scaffolding src/crypter.udl
|
||||||
|
|
||||||
|
echo "=> building i686-linux-android"
|
||||||
|
cross build --target i686-linux-android --release
|
||||||
|
echo "=> building aarch64-linux-android"
|
||||||
|
cross build --target aarch64-linux-android --release
|
||||||
|
echo "=> building armv7-linux-androideabi"
|
||||||
|
cross build --target armv7-linux-androideabi --release
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
uniffi_build::generate_scaffolding("./src/crypter.udl").unwrap();
|
|
||||||
}
|
|
||||||
@@ -2,22 +2,21 @@ uniffi-bindgen --version
|
|||||||
|
|
||||||
should match the uniffi version in Cargo.toml
|
should match the uniffi version in Cargo.toml
|
||||||
|
|
||||||
|
### build the C ffi
|
||||||
|
|
||||||
|
uniffi-bindgen scaffolding src/crypter.udl
|
||||||
|
|
||||||
### kotlin
|
### kotlin
|
||||||
|
|
||||||
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-unknown-linux-gnu
|
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
uniffi-bindgen generate src/crypter.udl --language kotlin
|
uniffi-bindgen generate src/crypter.udl --language kotlin
|
||||||
|
|
||||||
cargo build --target aarch64-linux-android --release
|
cross build --target i686-linux-android --release
|
||||||
cargo build --target armv7-linux-androideabi --release
|
|
||||||
cargo build --target i686-linux-android --release
|
|
||||||
|
|
||||||
cross build --target aarch64-linux-android --release
|
cross build --target aarch64-linux-android --release
|
||||||
|
cross build --target armv7-linux-androideabi --release
|
||||||
|
|
||||||
### swift
|
### swift
|
||||||
|
|
||||||
uniffi-bindgen generate src/crypter.udl --language swift
|
uniffi-bindgen generate src/crypter.udl --language swift
|
||||||
|
|
||||||
### manually build the C ffi
|
|
||||||
|
|
||||||
uniffi-bindgen scaffolding src/crypter.udl
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ mod parse;
|
|||||||
use sphinx_key_crypter::chacha::{decrypt as chacha_decrypt, encrypt as chacha_encrypt};
|
use sphinx_key_crypter::chacha::{decrypt as chacha_decrypt, encrypt as chacha_encrypt};
|
||||||
use sphinx_key_crypter::ecdh::derive_shared_secret_from_slice;
|
use sphinx_key_crypter::ecdh::derive_shared_secret_from_slice;
|
||||||
|
|
||||||
uniffi_macros::include_scaffolding!("crypter");
|
include!("crypter.uniffi.rs");
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, CrypterError>;
|
pub type Result<T> = std::result::Result<T, CrypterError>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user