9d46e26f50
- P0 闸达成:新增 macOS 独立单测 target CommilitiaDropMacTests(把 LibWebRtcEngine.swift 直接编入测试 bundle,无宿主 app、同模块无需 @testable),跑与 iOS 同一份环回端到端测试——两个引擎同进程交叉连,20MB 伪随机源逐字节比对。macOS 上线协议(offer/answer/ICE + 分片 / 背压 / ack / finalize)在 libwebrtc 闭环,证实原生数据面在 Mac 可用(≈3s 通过)。是 Mac 复用 iOS 引擎的技术前提 - 修 stasel/WebRTC 149.0.0 原生 macOS 切片缺头:macos-x86_64_arm64 随包只带 umbrella WebRTC.h、缺全部 80+ 子头(ios / maccatalyst / simulator 三切片各 93 头齐全),umbrella #import 的子头找不到致 import WebRTC 在原生 macOS 编不过;切片二进制本身有效(arm64+x86_64 dylib)。scripts/patch-macos-webrtc-headers.sh 从同包 ios-arm64 切片补齐(子头为平台守卫 ObjC 声明、跨切片同构;排除 3 个 UIKit 绑定视图头 + 从 umbrella 去掉本包缺失的 RTCMTLNSVideoView.h)。幂等,须 SPM resolve 之后、build 之前跑 - LibWebRtcEngineTests.swift 导入条件化:仅 #if os(iOS) 时 @testable import CommilitiaDrop(macOS 侧引擎编在同模块、无需 import),iOS 与 macOS 共用同一份测试文件验证同构闭环 - Justfile:mac-prep(xcodegen + -resolvePackageDependencies + 补头脚本)→ mac-build / mac-test 均依赖之;build / test 加 -disableAutomaticPackageResolution 防 build 期再解析冲掉补丁 - 验证:just mac-test 从残缺态复现全绿——resolve + 补头(1→90)+ 编译 + 环回测试通过
243 lines
11 KiB
YAML
243 lines
11 KiB
YAML
name: CommilitiaDrop
|
||
options:
|
||
bundleIdPrefix: net.commilitia
|
||
deploymentTarget:
|
||
iOS: "26.0"
|
||
macOS: "26.0"
|
||
createIntermediateGroups: true
|
||
# 源码以简体中文撰写;字符串目录承载 zh-Hant / en 翻译。语言跟随系统设置。
|
||
developmentLanguage: zh-Hans
|
||
# 原生数据面:iOS 走 libwebrtc(Safari 同款,与 iOS 网络栈原生集成)。预编译 xcframework 经
|
||
# stasel/WebRTC 以 SPM 分发,仅二进制 target,pin 精确版本避免上游 M 版跳变改 API。替换早先
|
||
# gomobile/pion 路径——pion 的 Go raw socket 不与 iOS Network framework 集成,真机确证不可靠
|
||
# (见 desktop/NATIVE-TRANSFER.md §7 / cdrop-native-data-plane 记忆)。libwebrtc 亦含 macOS 切片
|
||
# (macos-x86_64_arm64 + maccatalyst),故同一 LibWebRtcEngine 可在原生 Mac target 复用。
|
||
packages:
|
||
WebRTC:
|
||
url: https://github.com/stasel/WebRTC
|
||
exactVersion: 149.0.0
|
||
settings:
|
||
base:
|
||
SWIFT_VERSION: "5.0"
|
||
# 模拟器用 ad-hoc 签名(身份 "-",无需 Apple 账号),使 App Group / Push 等 entitlement 在
|
||
# 模拟器实际生效(否则共享容器不创建、远程通知注册失败)。真机签名须付费 ADP 配
|
||
# team / provisioning profile(账号门控,见 REALDEVICE.md)。macOS 本地开发同走 ad-hoc。
|
||
CODE_SIGN_IDENTITY: "-"
|
||
CODE_SIGNING_REQUIRED: "NO"
|
||
CODE_SIGNING_ALLOWED: "YES"
|
||
targets:
|
||
CommilitiaDrop:
|
||
type: application
|
||
platform: iOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: Sources
|
||
- path: Shared
|
||
dependencies:
|
||
- target: CommilitiaDropShare
|
||
embed: true
|
||
- target: CommilitiaDropWidgets
|
||
embed: true
|
||
# 原生数据面引擎(libwebrtc):SPM 预编 xcframework,Xcode 自动嵌入 + 签名。仅主 app 链接——
|
||
# Share / 控件扩展不碰数据面,避免超扩展 120MB 内存限。见 LibWebRtcEngine.swift。
|
||
- package: WebRTC
|
||
info:
|
||
path: Sources/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: Commilitia Drop
|
||
# 品牌字标字体 Fredoka SemiBold(Shared/Fonts/,随 bundle 打包),用于 Wordmark(与 web 一致)。
|
||
UIAppFonts:
|
||
- Fredoka-SemiBold.ttf
|
||
# cdrop:// URL scheme:Share Extension 交接后经 cdrop://share 深链唤起主 app 选设备发送。
|
||
CFBundleURLTypes:
|
||
- CFBundleURLName: net.commilitia.Commilitia-Drop
|
||
CFBundleURLSchemes:
|
||
- cdrop
|
||
# 声明支持的语言,使系统控件(EditButton 的「编辑」、滑动删除的「删除」等系统字符
|
||
# 串)跟随设备语言本地化,而非永远英文。开发区域设简体。
|
||
CFBundleDevelopmentRegion: zh-Hans
|
||
CFBundleLocalizations:
|
||
- zh-Hans
|
||
- zh-Hant
|
||
- en
|
||
UILaunchScreen: {}
|
||
# 界面方向:iPhone 竖屏 + 横屏(不含上下颠倒,遵 iPhone 惯例);iPad 支持全部 4 向——通用 App
|
||
# 若不锁全屏(UIRequiresFullScreen 未设),iPad 多任务(Split View / Slide Over)要求支持全部方向,
|
||
# 否则构建告警「All interface orientations must be supported...」。
|
||
UISupportedInterfaceOrientations:
|
||
- UIInterfaceOrientationPortrait
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
- UIInterfaceOrientationLandscapeRight
|
||
"UISupportedInterfaceOrientations~ipad":
|
||
- UIInterfaceOrientationPortrait
|
||
- UIInterfaceOrientationPortraitUpsideDown
|
||
- UIInterfaceOrientationLandscapeLeft
|
||
- UIInterfaceOrientationLandscapeRight
|
||
# 后台续传:BGContinuedProcessingTask 的通配标识符须在此声明,系统才允许注册 / 提交
|
||
# (见 BackgroundTaskManager)。默认资源(CPU + 网络)无需额外 entitlement。
|
||
BGTaskSchedulerPermittedIdentifiers:
|
||
- "net.commilitia.Commilitia-Drop.transfer.*"
|
||
# 远程通知后台模式:APNs 推送送达 / 后台处理(如「收到文件」通知)。
|
||
UIBackgroundModes:
|
||
- remote-notification
|
||
# 让接收文件落地的 Documents 目录在 Files app「我的 iPhone / Commilitia Drop」下
|
||
# 可见、可就地打开(收到的文件有处可开、可被其他 app 取用)。
|
||
UIFileSharingEnabled: true
|
||
LSSupportsOpeningDocumentsInPlace: true
|
||
NSAppTransportSecurity:
|
||
NSAllowsLocalNetworking: true
|
||
NSLocalNetworkUsageDescription: "Commilitia Drop 需要访问本地网络以发现同内网设备并建立直连传输。"
|
||
NSBonjourServices:
|
||
- "_cdrop._tcp"
|
||
NSCameraUsageDescription: "Commilitia Drop 使用相机扫描二维码登录新设备。"
|
||
# 图库选择:从相册选取图片 / 视频发送(PhotosPicker,见 RootView #14)。
|
||
NSPhotoLibraryUsageDescription: "Commilitia Drop 需要访问照片库,以便从相册选取图片或视频发送给其他设备。"
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop
|
||
TARGETED_DEVICE_FAMILY: "1,2"
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
# APNs 推送的 aps-environment entitlement(见 CDrop.entitlements)。模拟器取令牌可用;
|
||
# 真机签名须付费 ADP 开 Push 能力(账号门控)。
|
||
CODE_SIGN_ENTITLEMENTS: CDrop.entitlements
|
||
# Share Extension:抓分享文件 → App Group 收件箱 → 深链主 app 选设备发送(只交接、不跑引擎,
|
||
# 见 PLAN §I5)。只编 ShareViewController + 共享的 AppGroup,绝不拉主 app Sources(避超 120MB)。
|
||
CommilitiaDropShare:
|
||
type: app-extension
|
||
platform: iOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: Share
|
||
- path: Shared
|
||
# i18n JSON 随扩展 bundle 一并打包,使分享引导界面的 t() 文案随设备语言(同控件扩展)。
|
||
- path: Sources/Resources/i18n
|
||
info:
|
||
path: Share/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: Commilitia Drop
|
||
# 品牌字标字体(分享引导界面的 Wordmark 用),随扩展 bundle 打包 + 注册。
|
||
UIAppFonts:
|
||
- Fredoka-SemiBold.ttf
|
||
NSExtension:
|
||
NSExtensionPointIdentifier: com.apple.share-services
|
||
NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController
|
||
NSExtensionAttributes:
|
||
NSExtensionActivationRule:
|
||
NSExtensionActivationSupportsFileWithMaxCount: 20
|
||
NSExtensionActivationSupportsImageWithMaxCount: 20
|
||
NSExtensionActivationSupportsMovieWithMaxCount: 20
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop.share
|
||
TARGETED_DEVICE_FAMILY: "1,2"
|
||
CODE_SIGN_ENTITLEMENTS: Share/CDropShare.entitlements
|
||
# 控制中心剪贴板两控件(WidgetKit ControlWidget,iOS 18+,PLAN §I4)。纯原生 REST + 控件专用
|
||
# 设备会话(不跑引擎)。i18n JSON 一并打包使控件标签随设备语言(t() 经 no-subdir 回退读 bundle)。
|
||
CommilitiaDropWidgets:
|
||
type: app-extension
|
||
platform: iOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: Widgets
|
||
- path: Shared
|
||
- path: Sources/Resources/i18n
|
||
info:
|
||
path: Widgets/Info.plist
|
||
properties:
|
||
CFBundleDisplayName: Commilitia Drop
|
||
NSExtension:
|
||
NSExtensionPointIdentifier: com.apple.widgetkit-extension
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop.widgets
|
||
TARGETED_DEVICE_FAMILY: "1,2"
|
||
CODE_SIGN_ENTITLEMENTS: Widgets/CDropWidgets.entitlements
|
||
# 单元 / 集成测试(模拟器,无需签名):原生数据面 libwebrtc 引擎的环回端到端测试——两个
|
||
# LibWebRtcEngine 在同进程内交叉连,跑完整线协议(offer/answer/ICE + meta/分片/done + ack +
|
||
# 收尾)验证文件字节完整性。宿主即主 app(@testable import 取内部类型 + 经 app 链接 WebRTC)。
|
||
CommilitiaDropTests:
|
||
type: bundle.unit-test
|
||
platform: iOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: Tests
|
||
dependencies:
|
||
- target: CommilitiaDrop
|
||
- package: WebRTC
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop.tests
|
||
TEST_HOST: "$(BUILT_PRODUCTS_DIR)/CommilitiaDrop.app/CommilitiaDrop"
|
||
BUNDLE_LOADER: "$(TEST_HOST)"
|
||
GENERATE_INFOPLIST_FILE: "YES"
|
||
# 原生 macOS 客户端:桌面壳(MacApp/)替代 iOS 标签栏,@main 的 #if os(macOS) 分支驱动单窗口 +
|
||
# 菜单栏。与 iOS 同 bundle(net.commilitia.Commilitia-Drop,同 App Store 记录 / 同 App Group)。
|
||
# 当前为脚手架:仅编 MacApp/(导航骨架 + 菜单栏占位);引擎(LibWebRtcEngine + 离屏 WebView)与
|
||
# 复用视图随后续阶段并入。ARCHS arm64(本机 Apple Silicon);本地 ad-hoc 签名(base 继承)。
|
||
CommilitiaDropMac:
|
||
type: application
|
||
platform: macOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: MacApp
|
||
info:
|
||
path: Support/macOS/App-Info.plist
|
||
properties:
|
||
CFBundleName: Commilitia Drop
|
||
CFBundleDisplayName: Commilitia Drop
|
||
LSMinimumSystemVersion: "26.0"
|
||
CFBundleDevelopmentRegion: zh-Hans
|
||
CFBundleLocalizations:
|
||
- zh-Hans
|
||
- zh-Hant
|
||
- en
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop
|
||
PRODUCT_NAME: CommilitiaDropMac
|
||
ARCHS: arm64
|
||
# App Group entitlement(Support/macOS/AppMac.entitlements)在 macOS 属受限能力,即便
|
||
# ad-hoc 签名也须 provisioning profile;脚手架阶段(本地免账号编译 / 自测)暂不挂,待桌面
|
||
# 剪贴板 / 小组件共享落地 + Developer ID 签名(Phase 6)再引用该文件。见 AppMac.entitlements。
|
||
# 原生数据面 macOS 冒烟(P0 闸):把 LibWebRtcEngine.swift 直接编入独立测试 bundle(无宿主 app,
|
||
# 同模块无需 @testable import),跑与 iOS 同一份环回端到端测试——两个引擎同进程交叉连,验证
|
||
# libwebrtc 的 macOS 切片上线协议(offer/answer/ICE + 分片 / 背压 / ack / finalize)逐字节闭环。
|
||
# 证实原生数据面在 Mac 可用,是 Mac 复用 iOS 引擎的技术前提。
|
||
CommilitiaDropMacTests:
|
||
type: bundle.unit-test
|
||
platform: macOS
|
||
deploymentTarget: "26.0"
|
||
sources:
|
||
- path: Tests
|
||
- path: Sources/Engine/LibWebRtcEngine.swift
|
||
dependencies:
|
||
- package: WebRTC
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: net.commilitia.Commilitia-Drop.mac.tests
|
||
ARCHS: arm64
|
||
GENERATE_INFOPLIST_FILE: "YES"
|
||
schemes:
|
||
CommilitiaDrop:
|
||
build:
|
||
targets:
|
||
CommilitiaDrop: all
|
||
test:
|
||
targets:
|
||
- CommilitiaDropTests
|
||
gatherCoverageData: false
|
||
run:
|
||
config: Debug
|
||
CommilitiaDropMac:
|
||
build:
|
||
targets:
|
||
CommilitiaDropMac: all
|
||
test:
|
||
targets:
|
||
- CommilitiaDropMacTests
|
||
gatherCoverageData: false
|
||
run:
|
||
config: Debug
|
||
archive:
|
||
config: Release
|