Uh oh!
There was an error while loading. Please reload this page.
feat(shared-core): wrap the framework in a Swift target - #1297
Merged
Conversation
`binaries.linkerOpts` only reaches the binaries this module itself produces, so the ed25519 objects never travelled into a downstream framework -- the shared-core XCFramework exported `_ed25519_sign`/`_ed25519_verify` as undefined and left every consumer to supply them. The iOS app happens to compile the same C reference implementation, which is why nothing had failed yet; a standalone SPM consumer fails to link. `-staticLibrary`/`-libraryPath` on the cinterop puts the archive in the klib, so anything built from it carries the symbols.
The Kotlin/Native ObjC surface is not something an app should have to hold: byte payloads arrive as `KotlinByteArray`, objects come through `.shared`, and default arguments don't survive the export at all. Adding a `SharedCoreKit` Swift target over the binary framework moves that translation into the package -- iOS calls `KikCode.svg(payload:)` with `Data` and named defaults, and the framework itself is no longer a product. The Swift sources live here rather than in the Swift Package repo so the glue and the Kotlin it wraps move in one commit; the publish job copies them across, which also means `Package.swift` is ours now (KMMBridge rewrites only its variables block). The job builds the staged package against the framework it just uploaded before moving the tag, so a mismatch between the two can't reach a consumer.
Uh oh!
There was an error while loading. Please reload this page.
bmc08gt added a commit
that referenced
this pull request
Aug 21, 2026
…esign * origin/code/cash: fix(core): add \ to escape ' in What's (#1298) feat(shared-core): wrap the framework in a Swift target (#1297) chore: update display name entry title/hint (#1296) ci(shared-core): write a placeholder local.properties before publishing (#1295) build(shared-core): publish the XCFramework to flipcash-shared-core-spm (#1294) refactor(build-logic): extract the KMP test-fixture generator into a convention plugin (#1293) build(base58): declare the base58 lint tasks' dependency on generated fixtures (#1292) test(base58): run the vector gate on Kotlin/Native, not just the JVM (#1289) build(codes): declare the kikcode lint tasks' dependency on generated fixtures (#1288) # Conflicts: # apps/flipcash/core/src/main/res/values/strings.xml
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 freeto 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.
Follows #1294 / #1295. The published package now exposes Swift, not Kotlin/Native.
The problem
0.1.0shipped the raw XCFramework as its only product, so an iOS caller had to dothe bridging itself:
ByteArrayhas noDatabridge, Kotlinobjects arrive as.shared, and defaultarguments aren't exported at all — every call site has to pass every parameter.
The change
SharedCoreKitSwift target sits over the binary framework and is the package'sonly product; the framework is now an implementation detail of it. Callers write
KikCode.svg(payload: data)withDataand real defaults.kmp/shared-core/spm/— next to the Kotlin they wrap, soglue and Kotlin move in one commit and the Swift Package repo stays a publish target
rather than a place to edit. The job copies
Package.swift,Sources/, andTests/across before Gradle runs; KMMBridge is switched to
useCustomPackageFile, whichrewrites only the variables block inside our file.
moves the tag — the last point at which a mismatch between the Swift and the Kotlin
is cheap to fix.
The linkage bug it turned up
Building the package standalone failed to link:
_ed25519_signand_ed25519_verifywere undefined in the shipped framework.
binaries.linkerOptsonly affects the binaries:libs:encryption:ed25519itself produces, so the C objects never reached a downstreamframework. Nothing had failed before because the iOS app compiles the same C reference
implementation and satisfied the symbols by accident. The cinterop now embeds
libored25519.ainto the klib, so anything built from it carries them.