feat(ffi): warden_ffi_flutter plugin + dynamic-framework iOS build (#4)#6
Merged
Conversation
Phase 2 of #4: a Flutter plugin so any app (incl. maktub-app) consumes the Veil bridge with one pub.dev dependency — no Rust toolchain, no manual binary download, no Xcode/Gradle wiring. - ffi/flutter: warden_ffi_flutter plugin. Re-exports the warden_ffi binding; delivers the native lib per platform. iOS — the podspec's prepare_command downloads the prebuilt dynamic WardenFfi.xcframework from the warden release and CocoaPods embeds+signs it (dyld loads at launch → symbols resolve via DynamicLibrary.process(), no -force_load). Android — build.gradle downloads jniLibs and adds them as a source set. Native release tag pinned in both. - build-mobile.sh: add `ios-framework` mode building a DYNAMIC xcframework (cdylib → .framework with @rpath install name → xcframework). Static `ios` mode kept for back-compat. - mobile-ci/mobile-release: build the dynamic framework, assert the five warden_* symbols are exported (nm), and add a plugin analyze + `pub publish --dry-run` job. Verified locally: analyze clean, dry-run 0 warnings. The plugin downloads from warden release v0.1.0-dev.2 (the first dynamic-iOS build) — cut after this merges. pub.dev publish + the maktub-app swap follow once a real-device build confirms the dynamic framework loads. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of #4 — a Flutter plugin so any app (incl.
maktub-app) consumes the Veil bridge with one pub.dev dependency: no Rust toolchain, no manual binary download, no Xcode/Gradle wiring.What's in it
ffi/flutter/—warden_ffi_flutterplugin. Re-exports thewarden_ffibinding; its only job is delivering the native lib per platform:prepare_commanddownloads the prebuilt dynamicWardenFfi.xcframeworkfrom the warden release; CocoaPods embeds + signs it. dyld loads it at launch, soWardenFfi.load()resolves symbols viaDynamicLibrary.process()— no-force_load, no xcconfig.build.gradledownloadsjniLibs/<abi>/libwarden_ffi.soand adds them as a source set; Gradle bundles them.warden_tag/WARDEN_NATIVE_TAG).build-mobile.sh— newios-frameworkmode builds a dynamic xcframework (cdylib→.frameworkwith an@rpathinstall name →xcframework). The staticiosmode is kept for back-compat.mobile-ci/mobile-releasenow build the dynamic framework, assert the fivewarden_*symbols are exported (nm), and a newplugin-checkjob runsdart analyze+flutter pub publish --dry-run.Why dynamic framework (vs the static
.a+-force_load)A dynamic framework is what makes the plugin self-contained: CocoaPods embeds + signs vendored dynamic frameworks automatically and dyld loads them at launch, so the runtime-only
warden_*symbols are present with zero linker flags on the consumer. The static path needs the app to inject-force_load(whatmaktub-appdoes today inios/Flutter/*.xcconfig) — fine for one app, wrong for a reusable plugin.Verification
flutter pub get,dart analyzeclean,flutter pub publish --dry-run→ 0 warnings.build-mobile.shsyntax-checked;actionlintclean.macos-latestand assert symbol export (my proxy for the build being correct, since I can't run a device build locally).DynamicLibrary.process()finds the symbols in the embedded framework is confirmed only by a real-deviceflutter build. That's the gate before pub.dev publish.Sequence after merge
v0.1.0-dev.2→mobile-releasepublishes the dynamicWardenFfi.xcframework+ jniLibs (the tag the plugin pins).maktub-appat this plugin via a git dependency, run a real-device build to confirm load.warden_ffi_flutterto pub.dev and switch maktub-app to the hosted dep. (Supersedes the interim fetch-script PR, maktub-app#2.)🤖 Generated with Claude Code