build(shared-core): resolve a local XCFramework when FLIPCASH_SHARED_CORE_LOCAL is set - #1389
Merged
Merged
Conversation
…CORE_LOCAL is set Android compiles :kmp:shared-core from source, so a Kotlin change shows up in the next Android build. iOS consumes it as a published XCFramework pinned by version, so the same change needed the publish workflow, a moved tag, and a bumped pin before it could be tried at all. That cost is about to be paid per iteration: the derivation and bonding-curve moves are far more iterative than the beachhead was. The switch goes in the package manifest rather than in the app, because the app reaches SharedCoreKit twice — FlipcashUI depends on it, and Code.xcodeproj carries its own remote package reference for the app target's direct import. Overriding one leaves the other on the published package and resolution fails on duplicate SharedCore/SharedCoreKit targets. The publish job copies this manifest verbatim into the SPM repo, so the tagged copy the app resolves carries the same conditional and both consumers follow it. The path is rewritten relative to the package root because SwiftPM rejects an absolute binary-target path, and the published manifest is checked out into DerivedData with no Kotlin next to it. Loop and verification: docs/shared-core-local-development.md in the orchestrator.
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.
Android compiles
:kmp:shared-corefrom source, so a Kotlin change shows up in the next Android build. iOS consumes it as a published XCFramework pinned by version, so the same change needed the publish workflow, a moved tag, and a bumped pin before it could be tried at all. SettingFLIPCASH_SHARED_CORE_LOCALto acode-android-appcheckout swaps the published binary for one assembled from that checkout:This is
FLIPCASH_PROTO_LOCAL's equivalent for shared-core, and it matters more: the derivation and bonding-curve moves are far more iterative than the beachhead was.Why the switch is in the package manifest and not in the app. The iOS app reaches
SharedCoreKittwice —FlipcashUI/Package.swiftdepends on it, andCode.xcodeprojcarries its ownXCRemoteSwiftPackageReferencebecause the app target imports it directly. Overriding only FlipcashUI leaves the project reference on the published package, and resolution fails withmultiple similar targets 'SharedCore', 'SharedCoreKit' appear in package 'spm' and 'flipcash-shared-core-spm'. A SwiftPM mirror doesn't help either: it will only map a source-control dependency onto another git repository, not onto a directory. Putting the switch in this manifest works because the publish job copies it verbatim into the SPM repo, so the tagged copy the app resolves carries the same conditional and both consumers follow it —code-ios-appneeds no change.Two constraints follow from that. The variable holds a path to the checkout, since the published manifest lands in DerivedData with no Kotlin beside it; and SwiftPM rejects an absolute binary-target path, so the manifest rewrites it relative to
Context.packageDirectory.The override reaches the app only once a release carrying this manifest is published —
0.3.1predates it. The facade work cuts0.4.0anyway, so this needs no publish of its own.Local state can't ship: the opt-in is an environment variable, so no manifest is edited and
Package.resolvedis unchanged; the publish workflow never sets it, and its verify step compiles against the uploaded asset. If the variable is set and the framework hasn't been assembled, resolution fails naming the missing path rather than falling back to the published binary.The loop is written up in
docs/shared-core-local-development.mdin the orchestrator repo.