原生 macOS 客户端脚手架 + 元数据完整命名去缩写
- 命名去缩写:xcodegen 项目 + 四 target CDrop*→CommilitiaDrop*(CommilitiaDrop / …Share / …Widgets / …Tests);3 个 widget/control kind net.commilitia.cdrop.*→net.commilitia.Commilitia-Drop.*(旧装控件将成孤儿,需在设备重加);Tests @testable import CommilitiaDrop。刻意不动线协议 / 身份标识——bundle ID 家族、URL scheme cdrop://、Bonjour _cdrop._tcp、keychain service、DataChannel cdrop-file、entitlements 文件名——以免破跨端互通或丢会话 - 新增 macOS app target CommilitiaDropMac(platform macOS / deploymentTarget 26.0 / ARCHS arm64 / 与 iOS 同 bundle net.commilitia.Commilitia-Drop,同 App Store 记录 + 同 App Group):sources 仅 MacApp/,Info.plist 经 xcodegen 生成,本地 ad-hoc 免账号编译 - Mac 壳 MacApp/(Allman,#if os(macOS) 守卫,独立 @main 不与 iOS CDropApp 冲突):CommilitiaDropMacApp(@main + 单窗口 Window + windowResizability contentMinSize + 去 ⌘N + MenuBarExtra window 风格)、MacRootView(NavigationSplitView 侧栏五区骨架 传输/文件/消息/设备/设置 + 占位详情 MacPlaceholder + 品牌头)、MacMenuContent(菜单栏占位) - Support/macOS/AppMac.entitlements:App Group group.net.commilitia.Commilitia-Drop 预置待用;macOS 下 App Group 属受限能力须 provisioning profile,故脚手架阶段 project.yml 暂不引用,待 Phase 6 Developer ID 签名再挂 - 根 Justfile:ios-sim-build / ios-device 跟随重命名(项目 / scheme / .app 路径);新增 mac-build(xcodegen + xcodebuild -sdk macosx,本地 ad-hoc) - 验证:CommilitiaDropMac.app 与 CommilitiaDrop.app(iOS 模拟器)均 BUILD SUCCEEDED;WebRTC 走 -clonedSourcePackagesDirPath 复用已缓存 xcframework
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#if os(macOS)
|
||||
import SwiftUI
|
||||
|
||||
// 原生 macOS 客户端入口。单窗口 + 菜单栏常驻,桌面壳(MacRootView)替代 iOS 的标签栏。
|
||||
// 当前为脚手架:导航骨架 + 菜单栏占位;引擎(LibWebRtcEngine + 离屏 WebView)、复用视图与
|
||||
// 桌面专属功能(剪贴板自动同步 / 全局热键 / 原生通知)随后续阶段并入。iOS 入口另见 CDropApp。
|
||||
@main
|
||||
struct CommilitiaDropMacApp: App
|
||||
{
|
||||
var body: some Scene
|
||||
{
|
||||
// 启动即打开的单主窗口。
|
||||
Window("Commilitia Drop", id: "main")
|
||||
{
|
||||
MacRootView()
|
||||
.frame(minWidth: 820, minHeight: 560)
|
||||
}
|
||||
.defaultLaunchBehavior(.presented)
|
||||
.windowResizability(.contentMinSize)
|
||||
.commands
|
||||
{
|
||||
// 单窗口应用:移除「新建」(⌘N),对本应用无意义。
|
||||
CommandGroup(replacing: .newItem) {}
|
||||
}
|
||||
|
||||
// 菜单栏常驻:状态 + 快捷剪贴板 / Quick Send(当前占位)。
|
||||
MenuBarExtra
|
||||
{
|
||||
MacMenuContent()
|
||||
}
|
||||
label:
|
||||
{
|
||||
Image(systemName: "paperplane")
|
||||
}
|
||||
.menuBarExtraStyle(.window)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user