commit ecb948ba7a5de7931fe90a655cb384bb0051b9b5
parent e4d2f4bc26682cf3da701dbfcb26e62a6d971203
Author: triesap <tyson@radroots.org>
Date: Fri, 19 Jun 2026 16:16:09 -0700
ffi: rename shared ffi crate
- move the shared UniFFI crate to the language-neutral field_ffi directory.
- rename the Cargo package from radroots_app_ffi_swift to radroots_app_ffi.
- refresh the lockfile with the language-neutral package identity.
- keep Swift binding module configuration separate from shared crate naming.
Diffstat:
4 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/core/crates/tera_ffi/Cargo.toml b/core/crates/tera_ffi/Cargo.toml
@@ -0,0 +1,26 @@
+[package]
+name = "radroots_app_ffi"
+description = "Native FFI bindings for Radroots mobile apps"
+version.workspace = true
+edition.workspace = true
+authors = ["Radroots Authors"]
+rust-version.workspace = true
+license.workspace = true
+publish = false
+
+[lib]
+crate-type = ["staticlib", "cdylib"]
+
+[lints.rust]
+unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
+
+[[bin]]
+name = "uniffi-bindgen"
+path = "bin/uniffi-bindgen.rs"
+
+[build-dependencies]
+uniffi_build = { workspace = true }
+
+[dependencies]
+radroots_app_core = { workspace = true }
+uniffi = { workspace = true, features = ["cli"] }
diff --git a/core/crates/tera_ffi/bin/uniffi-bindgen.rs b/core/crates/tera_ffi/bin/uniffi-bindgen.rs
@@ -0,0 +1,19 @@
+fn main() {
+ run_bindgen();
+}
+
+#[cfg(not(coverage_nightly))]
+fn run_bindgen() {
+ uniffi::uniffi_bindgen_main()
+}
+
+#[cfg(coverage_nightly)]
+fn run_bindgen() {}
+
+#[cfg(all(test, coverage_nightly))]
+mod tests {
+ #[test]
+ fn main_is_callable_in_coverage_builds() {
+ super::main();
+ }
+}
diff --git a/core/crates/tera_ffi/src/lib.rs b/core/crates/tera_ffi/src/lib.rs
@@ -0,0 +1,16 @@
+radroots_app_core::uniffi_reexport_scaffolding!();
+
+pub fn coverage_branch_probe(input: bool) -> &'static str {
+ if input { "ffi" } else { "ffi" }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::coverage_branch_probe;
+
+ #[test]
+ fn coverage_branch_probe_hits_both_paths() {
+ assert_eq!(coverage_branch_probe(true), "ffi");
+ assert_eq!(coverage_branch_probe(false), "ffi");
+ }
+}
diff --git a/core/crates/tera_ffi/uniffi.toml b/core/crates/tera_ffi/uniffi.toml
@@ -0,0 +1,3 @@
+[bindings.swift]
+module_name = "RadrootsKitBindings"
+ffi_module_name = "RadrootsFFI"