feat(ios,android): setup uniffi infra (#8828)

This commit is contained in:
Brooooooklyn
2024-12-10 03:43:34 +00:00
parent 95597ec139
commit adc69548ef
26 changed files with 3097 additions and 124 deletions

View File

@@ -0,0 +1,19 @@
[package]
edition = "2021"
name = "affine_mobile_native"
version = "0.0.0"
[lib]
crate-type = ["cdylib", "staticlib"]
[[bin]]
# This can be whatever name makes sense for your project, but the rest of this tutorial assumes uniffi-bindgen.
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"
[dependencies]
affine_common = { workspace = true }
uniffi = { version = "0.28", features = ["cli"] }
[build-dependencies]
uniffi = { version = "0.28", features = ["build"] }

View File

@@ -0,0 +1,8 @@
use affine_common::hashcash::Stamp;
uniffi::setup_scaffolding!("affine_mobile_native");
#[uniffi::export]
pub fn hashcash_mint(resource: String, bits: u32) -> String {
Stamp::mint(resource, Some(bits)).format()
}

View File

@@ -0,0 +1,3 @@
fn main() {
uniffi::uniffi_bindgen_main()
}