Repository navigation
feat: add dari-kmp, a KMP entry point backed by the Swift SDK on iOS - #304
Merged
Merged
Conversation
The iOS side looks DariObjC up at runtime, so dari-kmp never links the Swift SDK.
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
16 tasks
Checks every DariObjC selector up front, delegates to dari/dari-noop on Android, adds publishing, tests, a Simulator script and the user guide.
dari_kmp_status_of / dari_kmp_interceptor_of take class names so iosTest can point them at runtime-registered fakes instead of the Swift SDK.
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.
Summary
Adds
dari-kmp, so a Kotlin Multiplatform app can record a WebView bridge kept incommonMainon Android and iOS (#13). Nothing is published here; it ships with the next full release.dari-ios:DariObjC/DariObjCInterceptor, an@objcentry point overDari/DariInterceptor. The Swift API is unchanged.dari-kmp:DariKmp.createInterceptor(tag): DariInterceptor?incommonMain.DariObjCat runtime through a cinterop.defwith no headers and no linked library.dari_kmp_status()checks every selector first, so an SDK older thandari-kmpreturns null and logs once instead of crashing.Dari.createInterceptor, compiled againstdari-nooponly, so the app'sdari/dari-noopchoice decides what runs.kotlin.mpp.enableCInteropCommonization=true, which the sharediosMainmetadata compile needs.commonMain.kmp-core.ymlruns thedari-kmpchecks;ios-sdk.ymlalso runs when the.defchanges./release-scopeand/releasecountdari-kmpas library.sample-kmp+sample-kmp/run-on-simulator.sh.sample-iosonly calls it under#if canImport(DariKmpSample), so its normal build doesn't change.docs/kmp-swift-bridge(.ko).md(design, alternatives, Swift export outlook, official references). The site user guide is in docs: add the Kotlin Multiplatform guide for dari-kmp #305.Merging this publishes nothing:
dari-kmpreaches Maven andDariObjCreaches SPM only with/release. The site guide (#305) is what must wait for that release.Verification
:dari-kmp:iosSimulatorArm64Test: without the Swift SDK linked, the factory returns null.SwiftSdkBindingTestruns the cinterop path against ObjC fakes registered at runtime: status 0/1/2, the tag reaching the factory, and every call forwarded with its arguments (fireAndForgetboxing,isSuccess, order). Mutating the selector checks or the argument passing makes it fail.:dari-kmp:testAndroidHostTest: withdari-noop, the factory returns null.dari-iosswift test: 55 tests pass. The newDariObjCTestsreads the.defand checks each selector exists, and checks that calls reach the store.:dari-kmp:compileIosMainKotlinMetadata,checkLegacyAbi,checkDariApiParity, and a publish to the localcompatrepo. The Android POM depends only ondari-coreand the stdlib.IosAppFinderclient.DariObjCsurvives-dead_strip.Not verified: a USB device (none connected), the desktop window itself, Android at runtime with
dari, andautoCapturefor WebKit calls made from Kotlin.