commit be7593e1e34711a0deebe40d135421784c7cd805
parent 0b9a9e2e209f87979ef3105a698a98b683214a4a
Author: triesap <tyson@radroots.org>
Date: Sun, 15 Feb 2026 19:06:48 +0000
build: minimize ios wrapper docs and makefiles
Diffstat:
4 files changed, 15 insertions(+), 35 deletions(-)
diff --git a/Makefile b/Makefile
@@ -2,20 +2,5 @@ WRAPPER_ROOT := $(CURDIR)/RadrootsCore
.PHONY: all clean build generate package bindings
-all:
- $(MAKE) -C $(WRAPPER_ROOT) all
-
-clean:
- $(MAKE) -C $(WRAPPER_ROOT) clean
-
-build:
- $(MAKE) -C $(WRAPPER_ROOT) build
-
-generate:
- $(MAKE) -C $(WRAPPER_ROOT) generate
-
-package:
- $(MAKE) -C $(WRAPPER_ROOT) package
-
-bindings:
- $(MAKE) -C $(WRAPPER_ROOT) bindings
+all clean build generate package bindings:
+ $(MAKE) -C $(WRAPPER_ROOT) $@
diff --git a/RadrootsCore/Cargo.toml b/RadrootsCore/Cargo.toml
@@ -11,6 +11,4 @@ description = "radroots ios rust wrapper manifest"
resolver = "2"
[workspace.dependencies]
-radroots-app-core = { path = "../../crates/app-core" }
radroots-app-ffi-swift = { path = "../../crates/app-ffi-swift" }
-radroots-app-wasm = { path = "../../crates/app-wasm" }
diff --git a/RadrootsCore/Makefile b/RadrootsCore/Makefile
@@ -5,6 +5,7 @@ CRATES_ROOT := $(abspath $(WRAPPER_ROOT)/../../crates)
FFI_MANIFEST := $(CRATES_ROOT)/app-ffi-swift/Cargo.toml
RUST_TARGET_DIR := $(WRAPPER_ROOT)/target
OUTDIR := $(RUST_TARGET_DIR)/xcframework
+CARGO_FFI := cd $(WRAPPER_ROOT) && CARGO_TARGET_DIR=$(RUST_TARGET_DIR) cargo
FRAMEWORK_DEST := $(IOS_ROOT)/RadrootsKit/Artifacts
GENERATED_SWIFT := $(IOS_ROOT)/RadrootsKit/Sources/RadrootsKit/Generated
@@ -30,15 +31,15 @@ clean:
build:
@echo "building $(CRATE) for ios device + simulator..."
- cd $(WRAPPER_ROOT) && CARGO_TARGET_DIR=$(RUST_TARGET_DIR) cargo build --manifest-path $(FFI_MANIFEST) --release --target aarch64-apple-ios
- cd $(WRAPPER_ROOT) && CARGO_TARGET_DIR=$(RUST_TARGET_DIR) cargo build --manifest-path $(FFI_MANIFEST) --release --target aarch64-apple-ios-sim
+ $(CARGO_FFI) build --manifest-path $(FFI_MANIFEST) --release --target aarch64-apple-ios
+ $(CARGO_FFI) build --manifest-path $(FFI_MANIFEST) --release --target aarch64-apple-ios-sim
@echo "building host cdylib for uniffi metadata..."
- cd $(WRAPPER_ROOT) && CARGO_TARGET_DIR=$(RUST_TARGET_DIR) cargo build --manifest-path $(FFI_MANIFEST) --release
+ $(CARGO_FFI) build --manifest-path $(FFI_MANIFEST) --release
generate:
@echo "generating swift bindings with uniffi..."
- cd $(WRAPPER_ROOT) && CARGO_TARGET_DIR=$(RUST_TARGET_DIR) cargo run --manifest-path $(FFI_MANIFEST) --bin uniffi-bindgen -- \
+ $(CARGO_FFI) run --manifest-path $(FFI_MANIFEST) --bin uniffi-bindgen -- \
generate --library $(HOST_DYLIB) \
--language swift \
--out-dir $(OUTDIR)/generated \
diff --git a/RadrootsCore/README.md b/RadrootsCore/README.md
@@ -1,23 +1,19 @@
# RadrootsCore
-`ios/RadrootsCore` is the iOS Rust wrapper entrypoint for shared app crates.
+`ios/RadrootsCore` is the iOS Rust wrapper for the shared Swift FFI crate.
-## Shared crates
-- backend runtime: `../../crates/app-core`
-- swift ffi surface: `../../crates/app-ffi-swift`
-- wasm surface: `../../crates/app-wasm`
+## Source of truth
+- `../../crates/app-ffi-swift` (built via `--manifest-path`)
## Dependency pattern
-This `Cargo.toml` follows the same local workspace dependency style used in `internal/.../radrootsd/Cargo.toml`:
-- local `path` dependencies during active development
-- dependency declarations centralized in `[workspace.dependencies]`
-- `radroots-app-ffi-swift` is intentionally anchored in `[workspace.dependencies]` and built via `Makefile --manifest-path`, not linked as a Rust `[dependencies]` crate
-
-When crates.io releases are ready, these paths can be switched to versioned dependencies while preserving this wrapper layout for OSS iOS consumers.
+- Keep `radroots-app-ffi-swift` in `[workspace.dependencies]` with a local `path` during development.
+- Switch this to a crates.io version later without changing the make/build flow.
+- Do not link `radroots-app-ffi-swift` as a Rust `[dependencies]` crate in this wrapper.
## Build flow
-Use `make -C ios/RadrootsCore` (or `make` from `ios/`) to:
+Run `make -C ios` (or `make -C ios/RadrootsCore`) to:
- build from `../../crates/app-ffi-swift/Cargo.toml`
- write Rust build artifacts under `ios/RadrootsCore/target`
- generate UniFFI Swift bindings
- package `RadrootsFFI.xcframework` into `ios/RadrootsKit/Artifacts`
+- copy generated Swift files into `ios/RadrootsKit/Sources/RadrootsKit/Generated`