Repository navigation
Development Setup zh HK
ChiFungHillmanChan edited this page Sep 16, 2026
·
7 revisions
English version: Development-Setup
- macOS 14 (Sonoma) 或以上
- Xcode 16+(Mac App Store 免費)——自帶 Swift 5.9 toolchain 同 Command Line Tools
- Git 2.30+
- 可選:
ghCLI 用嚟出 release
唔需要 Apple Developer account。Ad-hoc signing 足夠做 local build 同分發 DMG。
git clone https://github.com/ChiFungHillmanChan/setpiece.git
cd setpieceswift test應該見到 Executed 157 tests, with 0 failures。V0.1 → V0.4 進度:26(V0.1)→ 92(V0.2)→ 116(V0.3)→ 157(V0.4)。
-
V0.1(26):
Slot、Layout、LayoutEngine.plan/apply、Geometry.rectsApproxEqual、nearestSlot、Plan、WindowRef(用MockWindow)、AXPermissionsmoke。 -
V0.2(+66):
LayoutTemplate(slot math + sanitize)、CustomLayout/PresetSeeds/LayoutStore(Codable + persistence + seed semantics + block-save hotkey conflict)、HotkeyBinding(Carbon bridge + display string)、AnimationConfig/SettingsStore(default + clamp + observation)、FrameInterpolator(curve + endpoint 精確)、AnimationRunner(mock-clock interrupt / cancel / rapid retrigger)。 -
V0.3(+24):
DragSwapController狀態機(pickup / preview / swap / cancel)、DragSwapConfig(threshold clamp + persistence)、drag-detection 用嘅 nearest-slot 數學。 -
V0.4(+41):
Workspace/WorkspaceTrigger/FocusModeReferenceCodable round-trip、WorkspaceSeeds(4 個 seed、stable UUID、⌘⌥1–4 default)、WorkspaceStore(CRUD + persistence + observation + 跨 store hotkey 衝突)、縱向 seed 透過applyFutureSeedsmigration、WeekdayMaskOptionSet 編碼。
open SceneApp/SceneApp.xcodeproj揀 SceneApp scheme,⌘R。App 以 menu bar extra 身份行(冇 Dock icon)。
xcodebuild -project SceneApp/SceneApp.xcodeproj \
-scheme SceneApp \
-configuration Debug \
CODE_SIGNING_REQUIRED=NO \
buildCODE_SIGNING_REQUIRED=NO 避開 local keychain 偶爾出 errSecInternalComponent。唔影響行為。
./scripts/build-dmg.sh 0.4.0 # dist/Scene-0.4.0.dmg出 Apple Silicon(arm64)ad-hoc signed app,打包埋 /Applications drop shortcut。macOS 14+ 嘅機絕大部分都係 Apple Silicon;要兼容 Intel,喺 build script 加返 ARCHS="arm64 x86_64"。完整版本升級 workflow 見 Release-Process-zh-HK。
Setpiece 要 AX access 先郁到其他 app 嘅窗口。macOS 將呢個權限綁住 app 嘅 code signature 同路徑:
- 喺 Xcode 下跑嗰陣,app 每次 rebuild 都入
~/Library/Developer/Xcode/DerivedData/...。macOS 將佢哋當同一身份處理,所以授權一次就 persist。 - Debug / Release build 之間 switch 嗰陣,macOS 可能當佢哋係唔同 app,要再授權。
-
V0.4 TCC cdhash trap:ad-hoc signed 嘅 build,AX 授權綁住個 binary 嘅 cdhash。每次 rebuild 出新 cdhash,系統 toggle 睇落仲係 ON,但 AX API 其實 denied。症狀:rebuild 後 hotkey 靜靜噉唔 work。Fix:喺 System Settings → Privacy & Security → Accessibility 將 Setpiece entry OFF 完再 ON,或者跑
tccutil reset Accessibility com.hillman.SceneAppforce 個 prompt 由頭嚟。 - Rebuild 後 Setpiece 仲係唔識 permission,開 System Settings → Privacy & Security → Accessibility,將所有 SceneApp entry 移除,再重新授權。
Package.swift SceneCore library manifest
Sources/SceneCore/ 純 library(V0.4:AX/Animation/Display/Interaction/Layout/Settings/Workspace)
Tests/SceneCoreTests/ XCTest,157 個 case
SceneApp/SceneApp.xcodeproj Xcode project
SceneApp/SceneApp/ app-shell code(V0.4:Settings/、Stores/、Animation/、Interaction/、Workspace/Triggers/、Resources/)
scripts/build-dmg.sh DMG packager
docs/ INSTALL.md、TESTING.md(V0.1–V0.4 smoke section)
.gitignore ignore 晒 build/、dist/、xcuserdata、AI tool 檔
.gitignore 排除 local AI-session 檔(CLAUDE.md、.claude/ 等),唔會 commit 入 repo。
| 任務 | Command |
|---|---|
| 跑 core test | swift test |
| 跑一個 test | swift test --filter LayoutEnginePlanTests |
| 淨 compile 唔 run | swift build |
| Xcode debug build | xcodebuild … CODE_SIGNING_REQUIRED=NO build |
| Universal DMG | ./scripts/build-dmg.sh <version> |
| 清洗全部 | rm -rf .build build dist SceneApp/build |
English
繁體中文(香港)