Repository navigation
build(apple): share iOS state bridges with macOS - #1
Merged
Merged
Conversation
Move IosTaskListStateBridge, IosHabitListStateBridge, IosOverviewStateBridge and IosFocusTimerStateBridge from iosMain to appleMain, unchanged, so the macOS host can use them. Class names and the iOS framework header are unchanged (verified byte-identical). IosQuickAddBridge stays iOS-only.
AritxOnly
approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
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.
改动
把以下 4 个文件从
shared/src/iosMain/kotlin/com/deadliner/bridge/原样移到shared/src/appleMain/kotlin/com/deadliner/bridge/(纯移动,0 行内容变化):IosTaskListStateBridge.ktIosHabitListStateBridge.ktIosOverviewStateBridge.ktIosFocusTimerStateBridge.ktIosQuickAddBridge.kt依赖IosLifiCore(仅 iOS),保持在iosMain不动。原因
macOS 原生客户端(SwiftUI)需要与 iOS 相同的方式把 ViewModel 的
StateFlow交给 Swift。这 4 个桥接类只依赖 commonMain 的 ViewModel / Repository 与已有 macOS 实现的平台函数(例如updateWidget在macosArm64Main已有 actual),放到appleMain后 iOS 与 macOS 共用同一份实现,不需要在 macOS 侧复制。不影响 iOS
-PlifiMode=stub :shared:linkDebugFrameworkIosSimulatorArm64),生成的Shared.h逐字节一致。验证
./gradlew -PlifiMode=stub :shared:macosArm64Test:274 个测试全部通过(Xcode 27.2、Zulu 21)。未包含(供参考)
macosArm64目标没有声明binaries.framework。Mac 客户端在构建时用 Gradle 初始化脚本补上了导出,没有改动 Core。如果以后希望 Core 直接产出 macOS framework(或加入 XCFramework),可以另开一个改动。