-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.yml
More file actions
210 lines (203 loc) · 10.2 KB
/
Copy pathproject.yml
File metadata and controls
210 lines (203 loc) · 10.2 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
# xcodegen manifest for the FSKit extension packaging.
#
# brew install xcodegen # already installed
# xcodegen generate # -> fskit-s3.xcodeproj
# open fskit-s3.xcodeproj # pick the BBN team, Build & Run
#
# The Rust `ext` staticlib holds all logic; this project is only the ExtensionKit
# host app + extension target + the Swift @main bootstrap, signed by the BBN team.
name: fskit-s3
options:
bundleIdPrefix: dev.lucsoft.fskit-s3
# Minimum macOS 15.4 (FSKit). Liquid Glass (`.glassEffect`, `.buttonStyle(.glass)`)
# is 26-only, so it's applied behind `#available(macOS 26, *)` — earlier systems
# get the plain (non-glass) UI.
deploymentTarget:
macOS: "15.4"
createIntermediateGroups: true
settings:
base:
DEVELOPMENT_TEAM: H8563U643B
CODE_SIGN_STYLE: Automatic
SWIFT_VERSION: "5.0"
MARKETING_VERSION: "0.1.0"
CURRENT_PROJECT_VERSION: "1"
# Generate Swift asset-symbol extensions on Apple framework color/image types
# (e.g. `Color(.myColor)`), the modern default. Inert until an asset catalog
# exists, but on so any assets added later get type-safe symbols automatically.
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS: "YES"
# Generate Swift symbols for String Catalog entries (`String(localizable:)`),
# the modern default. Inert until a `.xcstrings` catalog exists — on so any
# added later gets type-safe accessors. (Xcode "recommended settings" item.)
STRING_CATALOG_GENERATE_SYMBOLS: "YES"
# Let the linker drop unreachable code (`-dead_strip`), Xcode's recommended
# default for every config. Safe here even though the Rust staticlibs export
# C entry points: everything FSKit/SwiftUI needs is reached through the call
# graph from Swift (`fskit_s3_make_filesystem`, the UniFFI `uniffi_*`
# scaffolding the generated bindings call), never via `dlsym`.
DEAD_CODE_STRIPPING: "YES"
# ENABLE_USER_SCRIPT_SANDBOXING stays OFF on purpose (Xcode recommends YES).
# Our Run Script phases genuinely need to write outside the sandbox: both
# `build-*-staticlib.sh` run `cargo`, which writes the shared `target/` dir and
# reads `~/.cargo`, and the app one also refreshes `xcode/host/Generated/*.swift`
# (a compiled source); `stamp-git-sha.sh` shells out to `git`, which touches
# `.git`. Under sandboxing those fail with "Operation not permitted" and the
# build dies in the pre-build phase. Declaring inputs/outputs can't help — cargo's
# write set isn't enumerable. Revisit only if the Rust build moves out of Xcode.
ENABLE_USER_SCRIPT_SANDBOXING: "NO"
configs:
# Hardened Runtime is required only by the **notary service** (Release/archive),
# and it is NOT compatible with the preview debug-dylib: with
# ENABLE_DEBUG_DYLIB=YES (which the host needs for SwiftUI previews) + Hardened
# Runtime, codesign fails signing the debug stub with "invalid or unsupported
# format for signature … .cstemp". So scope it to Release: Debug (dev + previews)
# skips it, archive keeps it for notarization.
Debug:
ENABLE_HARDENED_RUNTIME: "NO"
Release:
ENABLE_HARDENED_RUNTIME: "YES"
# You build/run the HOST app (it registers the embedded extension); an extension
# can't run on its own. Make a scheme for it so it shows in the selector.
schemes:
fskit-s3-host:
build:
targets:
fskit-s3-host: all
run:
config: Debug
# A scheme that builds the WHOLE app and is archivable. Building the host builds
# the embedded FSKit extension too (it's an embed dependency) plus both Rust
# staticlibs (their pre-build scripts), so this one target covers everything — the
# host is the single runnable, so Run launches the app rather than asking which
# app to run. Wired for every action, archive in Release, so Product ▸ Archive
# yields the complete signed .app with the .appex inside. Use `fskit-s3-host` for
# day-to-day dev; use this for a full build/archive.
fskit-s3:
build:
targets:
fskit-s3-host: all
run:
config: Debug
test:
config: Debug
profile:
config: Release
analyze:
config: Debug
archive:
config: Release
targets:
# -- Host app: carries the extension AND is the status-bar app. --
# A native SwiftUI menu-bar app (xcode/host/App.swift + Health.swift) on top of
# the Rust `fskit-s3-app` library, which is linked here as a staticlib and reached
# through a UniFFI contract: `uniffi-bindgen` emits the Swift bindings into
# xcode/host/Generated/ (regenerated by the pre-build script), and the bridging
# header exposes their C ABI. So there's one app: it vends the embedded FSKit
# extension and runs the UI. Mirror of the fskit-s3-ext target's staticlib linking.
fskit-s3-host:
type: application
platform: macOS
sources:
- xcode/host
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: dev.lucsoft.fskit-s3
PRODUCT_NAME: fskit-s3
# App icon in Apple's Icon Composer `.icon` format (xcode/host/fskit-s3.icon),
# bundled as a target source. macOS 26 / Xcode 26 renders it directly; the name
# is the bundle basename without the `.icon` extension.
ASSETCATALOG_COMPILER_APPICON_NAME: fskit-s3
CODE_SIGN_ENTITLEMENTS: xcode/App.entitlements
GENERATE_INFOPLIST_FILE: "YES"
# Status-bar (accessory) app: no Dock tile, no main window.
INFOPLIST_KEY_LSUIElement: "YES"
# Purpose string for the macOS Local Network privacy prompt, so the S3
# "Test & Save" check can reach a LAN endpoint (a non-loopback S3 host).
# loopback/localhost is exempt and needs only the network-client entitlement.
INFOPLIST_KEY_NSLocalNetworkUsageDescription: "Connects to your S3 endpoint to verify the bucket and credentials."
SWIFT_OBJC_BRIDGING_HEADER: xcode/host/Host-Bridging-Header.h
# Link the Rust app staticlib (built by the pre-build script below).
OTHER_LDFLAGS: "-L$(BUILT_PRODUCTS_DIR) -lfskit_s3_app"
configs:
# The debug dylib powers SwiftUI previews (Debug), but is a dev-only aid —
# keep it out of the Release archive so distribution ships a plain binary.
# (The host is a normally-launched app, so unlike the extension it can carry
# the debug dylib in Debug without the appex-launch problem.)
Debug:
ENABLE_DEBUG_DYLIB: "YES"
Release:
ENABLE_DEBUG_DYLIB: "NO"
preBuildScripts:
- name: "Build Rust staticlib (fskit-s3-app)"
script: '"$PROJECT_DIR/scripts/build-app-staticlib.sh"'
basedOnDependencyAnalysis: false
dependencies:
- target: fskit-s3-ext
embed: true
# Frameworks the Rust app staticlib references (objc2 crates don't auto-link;
# the final target must). AppKit/Foundation/CoreFoundation: the status-bar UI.
# FSKit: the FSClient extension-health query. ServiceManagement: SMAppService
# launch-at-login. Security + SystemConfiguration: the Keychain + the OpenDAL/
# reqwest/rustls S3 "Test & Save" check (same as the ext target). SwiftUI: the
# native UI (usually autolinked, listed explicitly for clarity).
- sdk: SwiftUI.framework
- sdk: AppKit.framework
- sdk: Foundation.framework
- sdk: CoreFoundation.framework
- sdk: FSKit.framework
- sdk: ServiceManagement.framework
- sdk: Security.framework
- sdk: SystemConfiguration.framework
postBuildScripts:
# Stamp this app's git SHA into its Info.plist (runs before code-signing),
# so the health check can compare it against the extension's SHA.
- name: "Stamp git SHA (host)"
script: '"$PROJECT_DIR/scripts/stamp-git-sha.sh"'
basedOnDependencyAnalysis: false
# -- FSKit extension: Swift @main bootstrap + the Rust staticlib. --
fskit-s3-ext:
type: extensionkit-extension
platform: macOS
sources:
- xcode/FileSystemExtension.swift
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: dev.lucsoft.fskit-s3.ext
PRODUCT_NAME: fskit-s3-ext
INFOPLIST_FILE: xcode/Extension-Info.plist
GENERATE_INFOPLIST_FILE: "NO"
# Xcode 16's debug-dylib splits the binary into a stub launcher + a
# .debug.dylib. The system launches app *extensions* directly, and that stub
# indirection breaks them ("Unable to invoke task", no logs/crash). So the
# EXTENSION opts out. This is scoped to the ext target on purpose: the HOST
# app keeps the default (YES), because SwiftUI previews render by injecting
# code through the debug dylib — a global NO here silently kills the app's
# preview canvas. (The host is a normal app, not a system-launched appex, so
# the debug dylib is fine there.)
ENABLE_DEBUG_DYLIB: "NO"
CODE_SIGN_ENTITLEMENTS: xcode/Extension.entitlements
SWIFT_OBJC_BRIDGING_HEADER: xcode/Extension-Bridging-Header.h
# Keep the default entry (_NSExtensionMain): with it the extension starts
# and services probeResource. (_main / Swift's @main entry made
# ExtensionKit fail to start the instance — "extensionKit error 2".)
# Link the Rust staticlib (built by the pre-build script below).
OTHER_LDFLAGS: "-L$(BUILT_PRODUCTS_DIR) -lfskit_s3_ext"
preBuildScripts:
- name: "Build Rust staticlib (fskit-s3-ext)"
script: '"$PROJECT_DIR/scripts/build-ext-staticlib.sh"'
basedOnDependencyAnalysis: false
postBuildScripts:
# Stamp the extension's git SHA into its Info.plist (before code-signing),
# matching the SHA compiled into the staticlib and logged at activate.
- name: "Stamp git SHA (ext)"
script: '"$PROJECT_DIR/scripts/stamp-git-sha.sh"'
basedOnDependencyAnalysis: false
dependencies:
- sdk: FSKit.framework
- sdk: ExtensionFoundation.framework
# Pulled in by the Rust staticlib once fskit-s3-backend (OpenDAL/reqwest/
# rustls) + security-framework are linked: Security for Keychain + TLS trust,
# SystemConfiguration for proxy/DNS resolution. If the linker still reports
# "Undefined symbols … framework", add the named framework here too.
- sdk: Security.framework
- sdk: SystemConfiguration.framework