mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-10-29 21:53:43 +00:00
LOCALIZED_STRING_SWIFTUI_SUPPORT(Use Compiler to Extract Swift Strings)置 NO:IDE 构建不再把 SwiftUI 字面量写进 Localizable.xcstrings。该目录按仓库惯例手工维护少量 key(中英对照), 自动抽取会在 Xcode 打开构建时膨胀文件(#81 人工验收时实测 88+ key)。
252 lines
11 KiB
YAML
252 lines
11 KiB
YAML
name: ShadowsocksX-NG2
|
||
options:
|
||
createIntermediateGroups: true
|
||
developmentLanguage: zh-Hans
|
||
deploymentTarget:
|
||
macOS: "15.0"
|
||
settings:
|
||
base:
|
||
ARCHS: arm64
|
||
SWIFT_VERSION: "6.0"
|
||
# 关闭「Use Compiler to Extract Swift Strings」:构建期不再把 SwiftUI
|
||
# 字面量自动抽取进 xcstrings——本仓库目录按需手工增删 key(中英对照),
|
||
# 自动抽取会在 IDE 构建时膨胀文件(2026-10-04 #81 验收时实测)。
|
||
LOCALIZED_STRING_SWIFTUI_SUPPORT: NO
|
||
CODE_SIGN_STYLE: Manual
|
||
DEVELOPMENT_TEAM: S878RH3PA8
|
||
ENABLE_HARDENED_RUNTIME: YES
|
||
configs:
|
||
Release:
|
||
# 发布基线:签名 entitlements 必须只来自项目 entitlements 文件(保持最小)。
|
||
CODE_SIGN_INJECT_BASE_ENTITLEMENTS: NO
|
||
targets:
|
||
ShadowsocksX-NG2:
|
||
type: application
|
||
platform: macOS
|
||
sources:
|
||
- path: App
|
||
# 领域核心:配置目录树、凭据引用与持久化(spec #21 D3/D5)
|
||
- path: Domain
|
||
# LaunchAgent 注册清单:SMAppService.agent(plistName:) 从 bundle 内
|
||
# Contents/Library/LaunchAgents/ 读取;ProgramArguments 用 bundle 相对路径
|
||
# (spec #21 D2,issue #27)。
|
||
- path: LaunchAgent/com.qiuyuzhou.ShadowsocksX-NG2.agent.plist
|
||
buildPhase:
|
||
copyFiles:
|
||
destination: wrapper
|
||
subpath: Contents/Library/LaunchAgents
|
||
# 特权系统代理 helper 的 LaunchDaemon 注册清单(issue #71):
|
||
# SMAppService.daemon(plistName:) 从 bundle 内
|
||
# Contents/Library/LaunchDaemons/ 读取;可执行路径用 BundleProgram 键
|
||
# (bundle 相对;ProgramArguments 的相对路径按 PATH 解析会 spawn 失败);
|
||
# MachServices 键支撑 on-demand 激活。
|
||
- path: LaunchDaemons/com.qiuyuzhou.ShadowsocksX-NG2.systemproxy.plist
|
||
buildPhase:
|
||
copyFiles:
|
||
destination: wrapper
|
||
subpath: Contents/Library/LaunchDaemons
|
||
# 外部二进制(Vendor/<name>/manifest.json 固定 tag+URL+SHA-256)。必须先跑
|
||
# Scripts/fetch-external-binaries.sh 再 xcodegen generate:文件在生成时必须已存在,
|
||
# 否则 Copy Files 阶段会被静默丢弃。构建内的 preBuildScripts 只做增量复验,
|
||
# 哈希或清单漂移会在构建时失败。
|
||
- path: Vendor/sslocal/sslocal
|
||
buildPhase:
|
||
copyFiles:
|
||
destination: wrapper
|
||
subpath: Contents/Helpers
|
||
- path: Vendor/v2ray-plugin/v2ray-plugin
|
||
buildPhase:
|
||
copyFiles:
|
||
destination: wrapper
|
||
subpath: Contents/Helpers/Plugins
|
||
# 内置规则快照(issue #63/#64):普通构建只读本地已固定快照,离线且不重新
|
||
# 抓取或转换;缺失、损坏或版本不匹配时 verify-rule-snapshots.sh 使构建失败。
|
||
# folder reference 保留 rules/<source>/snapshot.json 结构,避免多个
|
||
# snapshot.json 在 bundle 根目录撞名。
|
||
- path: Vendor/rules
|
||
buildPhase: resources
|
||
type: folder
|
||
preBuildScripts:
|
||
- name: Fetch & verify external binaries
|
||
basedOnDependencyAnalysis: false
|
||
script: |
|
||
set -e
|
||
"$SRCROOT/Scripts/fetch-external-binaries.sh"
|
||
- name: Verify rule snapshots
|
||
basedOnDependencyAnalysis: false
|
||
script: |
|
||
set -e
|
||
"$SRCROOT/Scripts/verify-rule-snapshots.sh"
|
||
postBuildScripts:
|
||
# 必须在 app 自身签名之前逐二进制 DevID 重签;Xcode 在所有脚本阶段之后
|
||
# 完成 app 外层签名,封存重签后的嵌套代码。
|
||
- name: Sign embedded helpers
|
||
basedOnDependencyAnalysis: false
|
||
script: |
|
||
set -e
|
||
"$SRCROOT/Scripts/sign-embedded-helpers.sh"
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.qiuyuzhou.ShadowsocksX-NG2
|
||
PRODUCT_NAME: ShadowsocksX-NG2
|
||
# 模块名让位给 Core 镜像库(ShadowsocksX_NG2):两者 swiftmodule 都落
|
||
# 共享 Products 目录,重名会互相覆盖;app 可执行自身不 import 任何
|
||
# 消费方,改名零影响。
|
||
PRODUCT_MODULE_NAME: ShadowsocksX_NG2App
|
||
CODE_SIGN_IDENTITY: "Developer ID Application"
|
||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||
MARKETING_VERSION: "2.0.0"
|
||
# 必须 > 旧版 1.x 已发布构建的 CFBundleVersion(始终为 1),保证 build 号严格递增。
|
||
CURRENT_PROJECT_VERSION: 2
|
||
info:
|
||
path: App/Info.plist
|
||
properties:
|
||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
|
||
LSMinimumSystemVersion: "15.0"
|
||
LSUIElement: true
|
||
NSPrincipalClass: NSApplication
|
||
LSApplicationCategoryType: public.app-category.utilities
|
||
entitlements:
|
||
path: App/ShadowsocksX-NG2.entitlements
|
||
properties: {}
|
||
scheme:
|
||
testTargets:
|
||
# 单测多 runner 并行执行:夹具均为进程私有资源(运行时空闲端口、
|
||
# UUID 后缀的 UserDefaults suite 与 Keychain service、匿名 XPC
|
||
# listener、临时目录),跨 runner 无共享状态。
|
||
- name: ShadowsocksX-NG2Tests
|
||
parallelizable: true
|
||
dependencies:
|
||
# 代理运行时 wrapper(BundleProgram,spec #21 D2):以独立可执行文件装入
|
||
# Contents/MacOS,由 LaunchAgent plist 以 bundle 相对路径引用。
|
||
- target: ShadowsocksX-NG2Agent
|
||
copy:
|
||
destination: wrapper
|
||
subpath: Contents/MacOS
|
||
# 特权系统代理 helper(issue #71):独立可执行文件装入 Contents/MacOS,
|
||
# 由 LaunchDaemon plist 以 bundle 相对路径引用,SMAppService.daemon 注册。
|
||
- target: ShadowsocksX-NG2SystemProxyHelper
|
||
copy:
|
||
destination: wrapper
|
||
subpath: Contents/MacOS
|
||
ShadowsocksX-NG2Core:
|
||
type: library.static
|
||
platform: macOS
|
||
# 测试专用 app 源码镜像(去宿主化,ADR 0021):与 app target 同源编译
|
||
# (除 @main 组合根 MainApp.swift),模块名沿用 ShadowsocksX_NG2,全部
|
||
# 测试的 @testable import 零改动。测试 bundle 改链本库后不再生成
|
||
# TEST_HOST:xcodebuild test 只构建 app、不再启动 app 进程,与安装版
|
||
# 运行实例零接触。同源双编译沿用 Agent/Helper 共享 Domain 文件的既定
|
||
# 模式;Core 只被测试 target 依赖,发布链与普通构建不编译它。
|
||
sources:
|
||
- path: App
|
||
excludes:
|
||
- "MainApp.swift"
|
||
- "Info.plist"
|
||
- "ShadowsocksX-NG2.entitlements"
|
||
- "Assets.xcassets"
|
||
- path: Domain
|
||
settings:
|
||
base:
|
||
PRODUCT_NAME: ShadowsocksX-NG2Core
|
||
PRODUCT_MODULE_NAME: ShadowsocksX_NG2
|
||
# 静态库产物不签名(app 的 DevID 身份不适用)。
|
||
CODE_SIGNING_ALLOWED: NO
|
||
ShadowsocksX-NG2Agent:
|
||
type: tool
|
||
platform: macOS
|
||
sources:
|
||
- path: Agent
|
||
# wrapper 与 GUI 共享的跨进程契约:路径常量、运行时文档(含读取侧校验)
|
||
# 与日志事件基线(spec #21 D5);监听建立判定复用端点探测(issue #38)。
|
||
- path: Domain/RuntimePaths.swift
|
||
- path: Domain/AtomicFileWriter.swift
|
||
- path: Domain/ProxyACL.swift
|
||
- path: Domain/ProxyRule.swift
|
||
- path: Domain/SslocalRuntimeDocument.swift
|
||
- path: Domain/SslocalListenSettings.swift
|
||
- path: Domain/RuntimeLog.swift
|
||
- path: Domain/EndpointHealthProbe.swift
|
||
- path: Domain/RuntimeSocketOwnershipProbe.swift
|
||
settings:
|
||
base:
|
||
PRODUCT_NAME: ShadowsocksX-NG2Agent
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.qiuyuzhou.ShadowsocksX-NG2.agent
|
||
CODE_SIGN_IDENTITY: "Developer ID Application"
|
||
ShadowsocksX-NG2SystemProxyHelper:
|
||
type: tool
|
||
platform: macOS
|
||
sources:
|
||
- path: SystemProxyHelper
|
||
# helper 与 GUI 共享的 typed 契约与纯逻辑:closed typed 配置、property
|
||
# list 映射、计划器、XPC 协议与请求引擎(issue #71)。helper 不含产品
|
||
# 策略:不在这些文件之外做任何域判断。
|
||
- path: Domain/SystemProxyConfiguration.swift
|
||
- path: Domain/SystemProxyPlan.swift
|
||
- path: Domain/SystemProxyPropertyList.swift
|
||
- path: Domain/SystemProxyHelperContract.swift
|
||
- path: Domain/SystemProxyHelperEngine.swift
|
||
- path: Domain/SystemProxyHelperListenerDelegate.swift
|
||
settings:
|
||
base:
|
||
PRODUCT_NAME: ShadowsocksX-NG2SystemProxyHelper
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.qiuyuzhou.ShadowsocksX-NG2.systemproxy.helper
|
||
CODE_SIGN_IDENTITY: "Developer ID Application"
|
||
ShadowsocksX-NG2Tests:
|
||
type: bundle.unit-test
|
||
platform: macOS
|
||
sources:
|
||
- path: Tests
|
||
# 真实进程冒烟归 SmokeTests target,不进默认 task test 快车道。
|
||
excludes:
|
||
- "Smoke"
|
||
- "Fixtures"
|
||
- path: Tests/Fixtures/RuleSnapshots
|
||
type: folder
|
||
buildPhase: resources
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.qiuyuzhou.ShadowsocksX-NG2.Tests
|
||
# 必须与宿主 app 同 Team 签名:Hardened Runtime 的 library validation 拒绝
|
||
# 加载不同 Team ID 的非平台库,ad-hoc("-")签名的 xctest 包无法注入。
|
||
CODE_SIGN_IDENTITY: "Apple Development"
|
||
info:
|
||
path: Tests/Info.plist
|
||
properties: {}
|
||
dependencies:
|
||
# 去宿主化(ADR 0021):单测链 Core 静态库镜像而非 app 可执行,测试在
|
||
# 独立 xctest runner 中运行,宿主 app 不再被启动。
|
||
- target: ShadowsocksX-NG2Core
|
||
ShadowsocksX-NG2SmokeTests:
|
||
type: bundle.unit-test
|
||
platform: macOS
|
||
sources:
|
||
- path: Tests/Smoke
|
||
# app 产物定位 helper(与单测 target 共享,见 Tests/AppArtifact.swift)。
|
||
- path: Tests/AppArtifact.swift
|
||
settings:
|
||
base:
|
||
PRODUCT_BUNDLE_IDENTIFIER: com.qiuyuzhou.ShadowsocksX-NG2.SmokeTests
|
||
# 同 Team 签名理由同 ShadowsocksX-NG2Tests。
|
||
CODE_SIGN_IDENTITY: "Apple Development"
|
||
info:
|
||
path: Tests/Smoke/Info.plist
|
||
properties: {}
|
||
dependencies:
|
||
# 去宿主化(ADR 0021):smoke 同样链 Core 镜像库;真实 sslocal/agent 从
|
||
# scheme 构建的 app 产物取(AppArtifact),宿主 app 不再被启动。
|
||
- target: ShadowsocksX-NG2Core
|
||
schemes:
|
||
# 真实进程冒烟独立 scheme(task test:smoke):拉起真实 sslocal,按需执行;
|
||
# 发布门槛要求与 packaging-gate 一起全绿。
|
||
ShadowsocksX-NG2Smoke:
|
||
build:
|
||
targets:
|
||
ShadowsocksX-NG2: [run, test]
|
||
ShadowsocksX-NG2SmokeTests: [test]
|
||
test:
|
||
targets:
|
||
- name: ShadowsocksX-NG2SmokeTests
|
||
parallelizable: true
|