-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathproject.yml
More file actions
238 lines (231 loc) · 9.19 KB
/
Copy pathproject.yml
File metadata and controls
238 lines (231 loc) · 9.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: Macterm
options:
bundleIdPrefix: com.thdxg
deploymentTarget:
macOS: "14.0"
createIntermediateGroups: true
defaultConfig: Release
generateEmptyDirectories: true
configs:
Debug: debug
Release: release
settings:
base:
SWIFT_VERSION: "6.0"
SDKROOT: macosx
MACOSX_DEPLOYMENT_TARGET: "14.0"
ONLY_ACTIVE_ARCH: NO
SWIFT_STRICT_CONCURRENCY: complete
DEAD_CODE_STRIPPING: YES
ENABLE_HARDENED_RUNTIME: YES
CODE_SIGN_STYLE: Manual
CODE_SIGN_IDENTITY: "-"
DEVELOPMENT_TEAM: ""
CLANG_CXX_LANGUAGE_STANDARD: "c++17"
CLANG_CXX_LIBRARY: "libc++"
configs:
Debug:
ONLY_ACTIVE_ARCH: YES
Release:
ONLY_ACTIVE_ARCH: NO
packages:
Sparkle:
url: https://github.com/sparkle-project/Sparkle
from: "2.6.0"
Yams:
url: https://github.com/jpsim/Yams
from: "5.0.0"
ArgumentParser:
url: https://github.com/apple/swift-argument-parser
from: "1.3.0"
targets:
Macterm:
type: application
platform: macOS
sources:
- path: Macterm
excludes:
- "Info.plist"
- "Macterm.entitlements"
- "Resources/ghostty"
- "Resources/terminfo"
- "Resources/zmx"
- "AppIcon.icon"
# Ghostty resources (themes + shell-integration), downloaded by setup.sh.
# Folder reference (not the default "group") because the contents are
# extensionless files Xcode would otherwise skip. Lands at
# Contents/Resources/ghostty — GHOSTTY_RESOURCES_DIR points here, matching
# a real Ghostty.app so libghostty resolves themes/shell-integration and
# derives TERMINFO as ../terminfo (the sibling dir below).
- path: Macterm/Resources/ghostty
type: folder
buildPhase: resources
# Compiled terminfo DB (downloaded by setup.sh) so TERM=xterm-ghostty
# resolves without a Ghostty.app install. Folder reference preserves the
# hashed macOS layout (terminfo/78/xterm-ghostty) and extensionless files.
# MUST land at Contents/Resources/terminfo — a SIBLING of ghostty/ — so
# libghostty's dirname(GHOSTTY_RESOURCES_DIR)/terminfo derivation hits it.
- path: Macterm/Resources/terminfo
type: folder
buildPhase: resources
# Icon Composer file. Xcode 26 prefers this over an Assets.xcassets
# AppIcon.appiconset when ASSETCATALOG_COMPILER_APPICON_NAME matches the
# filename — actool generates .icns + alternate appearances (light, dark,
# tinted, clear) automatically from the layered .icon source.
- path: Macterm/AppIcon.icon
type: file
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.thdxg.macterm
PRODUCT_NAME: Macterm
INFOPLIST_FILE: Macterm/Info.plist
CODE_SIGN_ENTITLEMENTS: Macterm/Macterm.entitlements
# Tells actool to render Macterm/AppIcon.icon (Icon Composer source)
# for the app icon. Matches the filename without the .icon extension.
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
# Marketing version & build number are written by the release script
# via xcodebuild -override; defaults below apply for local dev builds.
MARKETING_VERSION: "0.0.0"
CURRENT_PROJECT_VERSION: "0.0.0"
# Public Sparkle key is overridden in CI release builds. Updater.swift
# treats this placeholder as an explicit local-build disable switch.
SPARKLE_ED_PUBLIC_KEY: SPARKLE_ED_PUBLIC_KEY_PLACEHOLDER
GIT_COMMIT: GIT_COMMIT_PLACEHOLDER
# Bundle identifier of the in-bundle frameworks (Sparkle).
LD_RUNPATH_SEARCH_PATHS:
- "$(inherited)"
- "@executable_path/../Frameworks"
ENABLE_HARDENED_RUNTIME: YES
OTHER_LDFLAGS:
- "-lc++"
# Silence "umbrella header does not include header" warnings emitted
# when Clang imports the GhosttyKit module — ghostty.h doesn't list
# the vt/* sub-headers, and we can't modify the prebuilt xcframework.
OTHER_SWIFT_FLAGS:
- "-Xcc"
- "-Wno-incomplete-umbrella"
# Exposes the ObjC exception trampoline (System/ObjCExceptionCatcher.h)
# to Swift — @try/@catch has no Swift equivalent, and an uncaught
# NSException kills the app without a crash report. ARC is pinned on
# explicitly since the target now compiles an .m file.
SWIFT_OBJC_BRIDGING_HEADER: Macterm/Macterm-Bridging-Header.h
CLANG_ENABLE_OBJC_ARC: YES
# Display name (Dock / menu bar / Finder) — wired into Info.plist's
# CFBundleDisplayName. The bundle *name* (PRODUCT_NAME) stays "Macterm"
# in every config so TEST_HOST and on-disk layout don't shift.
PRODUCT_DISPLAY_NAME: Macterm
configs:
Debug:
# Distinct bundle ID + display name so the debug app coexists with a
# running release app (open won't conflate them) and logs filter
# cleanly by subsystem (scripts/logs.sh).
PRODUCT_BUNDLE_IDENTIFIER: com.thdxg.macterm.debug
PRODUCT_DISPLAY_NAME: Macterm Debug
dependencies:
# Build ordering only: the post-build script copies the CLI binary into
# the bundle, so it must exist before the app target finishes.
- target: MactermCLI
embed: false
- framework: GhosttyKit.xcframework
embed: false
- package: Sparkle
product: Sparkle
- package: Yams
product: Yams
- sdk: AppKit.framework
- sdk: Carbon.framework
- sdk: CoreGraphics.framework
- sdk: CoreText.framework
- sdk: Foundation.framework
- sdk: IOKit.framework
- sdk: IOSurface.framework
- sdk: Metal.framework
- sdk: MetalKit.framework
- sdk: QuartzCore.framework
- sdk: UserNotifications.framework
postCompileScripts:
# Copy the prebuilt zmx binary (downloaded by setup.sh from the thdxg/zmx
# release, like GhosttyKit) into the app bundle at
# Contents/Resources/zmx/zmx — ZmxClient resolves it via Bundle.main.
# Runs after compile so the bundle's Resources dir exists.
- script: "${SRCROOT}/scripts/embed-zmx.sh"
name: "Embed zmx"
basedOnDependencyAnalysis: false
postBuildScripts:
# Bundle the control CLI at Contents/Resources/bin/macterm. The app
# prepends this dir to PATH for spawned shells; scripts outside the app
# (the CI benchmark) invoke it by bundle path.
#
# Also bundle the `ghostty` shim at Contents/Resources/ssh-bridge/
# (MactermConfig.sshShimDirectory) — MactermConfig.regenerate points
# GHOSTTY_BIN_DIR there so the shell-integration ssh wrapper's
# `"$GHOSTTY_BIN_DIR/ghostty" +ssh` resolves to `macterm ssh` (see
# scripts/ghostty-shim.sh). Deliberately NOT Resources/bin or
# Contents/MacOS: both land on pane PATHs (EnvironmentSetup prepends
# bin; libghostty appends the exe dir), and the shim must never be
# reachable as a bare `ghostty`.
- name: "Bundle macterm CLI"
basedOnDependencyAnalysis: false
script: |
set -e
BIN_DIR="$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/bin"
mkdir -p "$BIN_DIR"
cp "$BUILT_PRODUCTS_DIR/macterm" "$BIN_DIR/macterm"
SHIM_DIR="$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/ssh-bridge"
mkdir -p "$SHIM_DIR"
cp "$SRCROOT/scripts/ghostty-shim.sh" "$SHIM_DIR/ghostty"
chmod +x "$SHIM_DIR/ghostty"
# The bundled control CLI (`macterm`). Shares ControlProtocol.swift with the
# app target so the wire codec can never drift between the two, and
# SSHWrapper.swift so `macterm ssh` and the app promise the same terminfo
# entry (both files are unit-tested through the app module).
MactermCLI:
type: tool
platform: macOS
sources:
- path: CLI
- path: Macterm/Control/ControlProtocol.swift
- path: Macterm/System/SSHWrapper.swift
dependencies:
- package: ArgumentParser
product: ArgumentParser
settings:
base:
PRODUCT_NAME: macterm
# The binary is `macterm` but the MODULE must not collide with the
# app's `Macterm` module (case-insensitive .swiftmodule paths in the
# shared products dir would otherwise clash).
PRODUCT_MODULE_NAME: MactermCLI
PRODUCT_BUNDLE_IDENTIFIER: com.thdxg.macterm.cli
MactermTests:
type: bundle.unit-test
platform: macOS
sources:
- MactermTests
dependencies:
- target: Macterm
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.thdxg.macterm.tests
GENERATE_INFOPLIST_FILE: YES
# Hosted test bundle: loads into Macterm.app at runtime so
# @testable import Macterm sees the module symbols. The app's
# AppDelegate detects xctest via XCTestConfigurationFilePath and
# skips the heavy launch path (libghostty init, hotkey install,
# etc.) so the test runner doesn't time out.
BUNDLE_LOADER: "$(TEST_HOST)"
TEST_HOST: "$(BUILT_PRODUCTS_DIR)/Macterm.app/Contents/MacOS/Macterm"
schemes:
Macterm:
build:
targets:
Macterm: all
MactermTests: [test]
run:
config: Debug
test:
config: Debug
targets:
- MactermTests
archive:
config: Release