forked from melonamin/agterm-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.yml
More file actions
237 lines (229 loc) · 9.8 KB
/
Copy pathproject.yml
File metadata and controls
237 lines (229 loc) · 9.8 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
name: agterm
options:
bundleIdPrefix: com.umputun
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"
ARCHS: arm64
ONLY_ACTIVE_ARCH: NO
SWIFT_STRICT_CONCURRENCY: complete
# The agtermTests scheme intentionally builds serially so the app's deep-sign
# phase finishes before Xcode places its hosted test bundle inside the app.
DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING: YES
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:
agtermCore:
path: agtermCore
targets:
agterm:
type: application
platform: macOS
sources:
- path: agterm
excludes:
- "Info.plist"
- "agterm.entitlements"
- "Resources/ghostty"
- "Resources/terminfo"
- "Resources/agent-status"
# committed SOURCE for agterm's own bundled theme(s); setup.sh stages it
# into Resources/ghostty/themes (above), so the source dir itself must not
# be pulled into the project tree or the app bundle.
- "Resources/custom-themes"
# 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: agterm/Resources/ghostty
type: folder
buildPhase: resources
# Compiled terminfo DB 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: agterm/Resources/terminfo
type: folder
buildPhase: resources
# Agent-status hooks package (the generic wrapper, shell integration, and
# agent-specific lifecycle adapters). Folder reference (not the default "group") so the
# extensionless .sh files, the shell/ subdir, and the exec bit survive.
# Lands at Contents/Resources/agent-status — the installer copies it from
# there to ~/.config/agterm/agent-status.
- path: agterm/Resources/agent-status
type: folder
buildPhase: resources
# Agent skill package (SKILL.md + reference.md + examples.md + troubleshooting.md + scripts).
# It lives at plugins/agterm/skills/agterm so the SAME directory is also the skill source for
# the Claude Code and Codex plugin manifests — one copy, three consumers. Folder reference so
# the whole dir copies verbatim to Contents/Resources/agterm; the installer copies it from
# there to ~/.claude/skills/agterm.
- path: plugins/agterm/skills/agterm
type: folder
buildPhase: resources
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.umputun.agterm
PRODUCT_NAME: agterm
INFOPLIST_FILE: agterm/Info.plist
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
CODE_SIGN_ENTITLEMENTS: agterm/agterm.entitlements
MARKETING_VERSION: "0.0.0"
CURRENT_PROJECT_VERSION: "0.0.0"
GIT_COMMIT: ""
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"
configs:
# Debug/dev builds get a DISTINCT bundle id. XCUITest terminates any running instance of the
# app-under-test's bundle id before launching, so a shared id would kill the deployed Release
# app the user runs daily. Release keeps the real id (com.umputun.agterm) — only Debug is
# isolated. (State/socket are path-based, not bundle-id-derived, so dev/test launches must still
# set AGTERM_STATE_DIR to avoid touching the real app-support state.)
Debug:
PRODUCT_BUNDLE_IDENTIFIER: com.umputun.agterm.debug
postBuildScripts:
# build the agtermctl CLI and bundle it at Contents/MacOS/agtermctl so the
# in-app "Install Command Line Tool" can symlink it into PATH. Runs before
# Xcode's automatic code-sign, and signs the helper ad-hoc (matching the
# app) so the app's signature seals an already-signed nested binary.
- name: Bundle agtermctl CLI
basedOnDependencyAnalysis: false
script: |
set -euo pipefail
# the app icon is the Icon Composer `AppIcon.icon`, compiled by actool into Assets.car +
# AppIcon.icns. xcodegen also lists it in Copy Bundle Resources, so a redundant loose
# AppIcon.icon lands in the bundle; remove it. A loose source `.icon` renders as the generic
# placeholder grid (so it must not win over the compiled icon), and its source xattrs would
# otherwise trip the re-seal below.
rm -rf "$CODESIGNING_FOLDER_PATH/Contents/Resources/AppIcon.icon"
core="$SRCROOT/agtermCore"
swift build --package-path "$core" -c release --product agtermctl
src="$(swift build --package-path "$core" -c release --product agtermctl --show-bin-path)/agtermctl"
dest="$CODESIGNING_FOLDER_PATH/Contents/MacOS/agtermctl"
mkdir -p "$(dirname "$dest")"
cp -f "$src" "$dest"
# ad-hoc sign the helper + re-seal the app (Debug/normal builds). Developer ID signing for
# releases is done authoritatively by scripts/release.sh AFTER xcodebuild returns (so it
# can't be clobbered by Xcode's own final code-sign, which also adds the required timestamp).
codesign --force --options runtime --sign - "$dest"
# re-seal the whole app: this phase can run AFTER Xcode's own code-sign on incremental
# builds, so adding the helper would otherwise break the seal. --deep re-signs every nested
# Mach-O too (the Debug agterm.debug.dylib, the helper).
codesign --force --deep --options runtime --entitlements "$SRCROOT/agterm/agterm.entitlements" --sign - "$CODESIGNING_FOLDER_PATH"
dependencies:
- framework: GhosttyKit.xcframework
embed: false
- package: agtermCore
- sdk: AppKit.framework
# libghostty calls Text Input Source Services (TISCopyCurrentKeyboard…)
# which live in Carbon; required to link the prebuilt xcframework.
- sdk: Carbon.framework
- sdk: CoreGraphics.framework
- sdk: CoreText.framework
- sdk: Foundation.framework
- sdk: IOKit.framework
- sdk: Metal.framework
- sdk: MetalKit.framework
- sdk: QuartzCore.framework
agtermUITests:
type: bundle.ui-testing
platform: macOS
sources:
- agtermUITests
dependencies:
- target: agterm
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.umputun.agtermUITests
TEST_TARGET_NAME: agterm
CODE_SIGN_IDENTITY: "-"
GENERATE_INFOPLIST_FILE: YES
# UI test code drives XCTest APIs that aren't Sendable-clean; the strict
# checking the app/agtermCore use isn't needed (and breaks) here.
SWIFT_STRICT_CONCURRENCY: minimal
# the runner is ad-hoc signed; hardened runtime on the test bundle causes
# a Team-ID mismatch when the runner loads the xctest bundle.
ENABLE_HARDENED_RUNTIME: NO
agtermTests:
type: bundle.unit-test
platform: macOS
sources:
- agtermTests
dependencies:
- target: agterm
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.umputun.agtermTests
GENERATE_INFOPLIST_FILE: YES
TEST_HOST: "$(BUILT_PRODUCTS_DIR)/agterm.app/Contents/MacOS/agterm"
BUNDLE_LOADER: "$(TEST_HOST)"
CODE_SIGN_IDENTITY: "-"
# Hosted AppKit tests call isolated app code on the main actor; strict
# checking adds XCTest boundary failures without improving that coverage.
SWIFT_STRICT_CONCURRENCY: minimal
# The ad-hoc-signed host must load the test bundle without Team-ID checks.
ENABLE_HARDENED_RUNTIME: NO
schemes:
agterm:
build:
targets:
agterm: all
agtermUITests: [test]
run:
config: Debug
test:
config: Debug
targets:
- agtermUITests
archive:
config: Release
agtermTests:
build:
# The app-hosted test bundle and host must be built serially; otherwise the
# app target's final deep-sign phase can observe a half-built xctest bundle.
parallelizeBuild: false
targets:
agterm: all
agtermTests: [test]
test:
config: Debug
macroExpansion: agtermTests
environmentVariables:
# Application-hosted XCTest starts `agtermApp.init()` before test `setUp`.
# Isolate every eager app dependency at process launch, and keep the
# control socket short enough for sockaddr_un without touching the live app.
AGTERM_STATE_DIR: "$(TARGET_TEMP_DIR)/agtermTests-state"
AGTERM_CONTROL_SOCKET: "/tmp/agterm-hosted-tests-$(UID).sock"
AGTERM_HOSTED_TESTS: "1"
targets:
- agtermTests