Add watchOS support#940
Draft
AlvaroBrey wants to merge 6 commits into
Draft
Conversation
- Fix watchosArm64 triple: Kotlin/Native's watchosArm64 is arm64_32 - Add watchOS linkerOpts to the generated cinterop def file - Add watchosTargets() helper for module build scripts - Opt apple/watchos source sets into ExperimentalForeignApi
…orArm64) - Rename iosMain/iosTest source sets to appleMain/appleTest in core, mappings and kn-core - Split presentCodeRedemptionSheet and showInAppMessagesIfNeeded into iosMain/watchosMain actuals: the native APIs don't exist on watchOS - Make mappings arm64_32-safe (NSInteger is 32 bits there) - either skips watchosDeviceArm64: arrow-core doesn't publish it - watchosX64 not added: removed in Kotlin 2.3.20 - Regenerate klib ABI dumps Fixes #126
- Build and test watchOS archs in CI - Move generated errors file path to appleMain - Document watchOS support (ui module stays iOS-only)
NSInteger commonizes to a variable-width type once watchosArm64 (arm64_32) is in the target set, which requires this opt-in in appleMain. Also compile the commonized metadata in CI, since it otherwise only compiles at publish time.
…ings and instances, drop dead watchosX64 branches - Clamp instead of sign-wrap for revenueMicros on 32-bit NSInteger - Share one AppleApiAvailability instance per file, extract repeated requirement messages into consts, align and/or wording with KDoc - Fix showStoreMessagesIfAvailable KDoc: the iOS actual does not log on older OS versions - Remove WATCHOS_X64 branches: Kotlin 2.3.20 removed the target - README: note either has no watchosDeviceArm64 variant
Self-contained (no workspace) so it can't conflict with the iOS chain's persisted build output. iOS jobs return to their previous shape.
Contributor
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0183d74. Configure here.
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.
WIP
Fixes #126
Note
Medium Risk
Large multi-module platform expansion and refactor of Apple source sets around purchase APIs; risk is mitigated by CI watchOS builds/tests and explicit availability guards, but paywall/UI modules remain iOS-only and behavior differs on watch for several StoreKit-adjacent APIs.
Overview
Adds watchOS as a supported Apple target for the core purchase SDK (
core,models,mappings,kn-core,result, and partialeither), and documents platform limits (no-ui/ paywalls on watch;-eitherskipswatchosDeviceArm64).KMP layout: Apple-specific code moves from
iosMaintoappleMain, withiosMain/watchosMainhandling APIs that exist only on one Apple OS (e.g. code redemption sheet and StoreKit in-app messages on iOS; log-only stubs on watchOS). SharedPurchasesApple implementation lives inappleMainwithexpect/actualhooks for those differences.Build & CI: New
watchosTargets()convention, Swift/cinterop updates (watchOS SDK paths,arm64_32vsarm64triples, removal of legacywatchosX64),UnsafeNumberopt-in for shared Apple cinterop, and a parallelbuild-and-test-watchosCircleCI job (compile +watchosSimulatorArm64Test). Generated error mappings path changes tomappings/.../appleMain/....Interop fixes: Mapping changes for 32-bit
watchosArm64(NSInteger, pricelongLongValue, ad revenue clamping). Public KDoc notes watchOS behavior for win-back, in-app messages, and code redemption.Reviewed by Cursor Bugbot for commit 0183d74. Bugbot is set up for automated code reviews on this repo. Configure here.