-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
452 lines (377 loc) · 16.5 KB
/
Copy pathjustfile
File metadata and controls
452 lines (377 loc) · 16.5 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# A3S GUI - Justfile
default:
@just --list
native-backend := if os() == "macos" {
"appkit"
} else if os() == "linux" {
"gtk4"
} else if os() == "windows" {
"winui"
} else {
error("unsupported operating system for native GUI examples")
}
# ============================================================================
# Build
# ============================================================================
# Build the default headless crate
build:
cargo build --locked
# Build release artifacts for the default headless crate
release:
cargo build --locked --release
# Build the native dogfood release artifact for this operating system
release-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo build --locked --release --features appkit-native --example appkit_dogfood
;;
Linux)
cargo build --locked --release --features gtk4-native --example gtk4_dogfood
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo build --locked --release --target x86_64-pc-windows-msvc --features winui-native --example winui_dogfood
;;
*)
echo "unsupported operating system for native GUI release builds: $(uname -s)" >&2
exit 1
;;
esac
# Stage a native dogfood bundle for this operating system
bundle-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
just bundle-appkit
;;
Linux)
just bundle-gtk4
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
just bundle-winui
;;
*)
echo "unsupported operating system for native GUI bundles: $(uname -s)" >&2
exit 1
;;
esac
# Build, stage, and validate the native dogfood bundle for this operating system
bundle-gate-native: bundle-native check-bundle-native
# Validate the staged native dogfood bundle for this operating system
check-bundle-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
just check-bundle-appkit
;;
Linux)
just check-bundle-gtk4
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
just check-bundle-winui
;;
*)
echo "unsupported operating system for native GUI bundle validation: $(uname -s)" >&2
exit 1
;;
esac
# Stage the macOS AppKit dogfood app bundle
bundle-appkit:
#!/usr/bin/env bash
set -euo pipefail
if [[ "$(uname -s)" != "Darwin" ]]; then
echo "bundle-appkit must run on macOS" >&2
exit 1
fi
cargo build --locked --release --features appkit-native --example appkit_dogfood
bundle_dir="target/release/bundle/A3SGuiDogfood.app"
rm -rf "$bundle_dir"
mkdir -p "$bundle_dir/Contents/MacOS" "$bundle_dir/Contents/Resources"
cp target/release/examples/appkit_dogfood "$bundle_dir/Contents/MacOS/A3SGuiDogfood"
cp packaging/macos/A3SGuiDogfood-Info.plist "$bundle_dir/Contents/Info.plist"
cp packaging/a3s-gui-dogfood-README.txt "$bundle_dir/Contents/Resources/README.txt"
printf 'APPL????' > "$bundle_dir/Contents/PkgInfo"
chmod +x "$bundle_dir/Contents/MacOS/A3SGuiDogfood"
packaging/write-bundle-manifest.sh "$bundle_dir" "$bundle_dir/Contents/Resources/MANIFEST.txt" "macos-appkit" "a3s-gui-dogfood-macos"
echo "staged $bundle_dir"
# Validate the staged macOS AppKit dogfood app bundle
check-bundle-appkit:
#!/usr/bin/env bash
set -euo pipefail
if [[ "$(uname -s)" != "Darwin" ]]; then
echo "check-bundle-appkit must run on macOS" >&2
exit 1
fi
bundle_dir="target/release/bundle/A3SGuiDogfood.app"
binary="$bundle_dir/Contents/MacOS/A3SGuiDogfood"
plist="$bundle_dir/Contents/Info.plist"
pkginfo="$bundle_dir/Contents/PkgInfo"
readme="$bundle_dir/Contents/Resources/README.txt"
manifest="$bundle_dir/Contents/Resources/MANIFEST.txt"
[[ -d "$bundle_dir/Contents/MacOS" ]] || { echo "missing app MacOS directory: $bundle_dir/Contents/MacOS" >&2; exit 1; }
[[ -d "$bundle_dir/Contents/Resources" ]] || { echo "missing app Resources directory: $bundle_dir/Contents/Resources" >&2; exit 1; }
[[ -x "$binary" ]] || { echo "missing executable app binary: $binary" >&2; exit 1; }
[[ -f "$plist" ]] || { echo "missing app Info.plist: $plist" >&2; exit 1; }
[[ -f "$pkginfo" ]] || { echo "missing app PkgInfo: $pkginfo" >&2; exit 1; }
[[ -f "$readme" ]] || { echo "missing app handoff README: $readme" >&2; exit 1; }
[[ -f "$manifest" ]] || { echo "missing app bundle manifest: $manifest" >&2; exit 1; }
[[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$plist")" == "A3SGuiDogfood" ]] || { echo "Info.plist CFBundleExecutable does not match A3SGuiDogfood" >&2; exit 1; }
[[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundlePackageType' "$plist")" == "APPL" ]] || { echo "Info.plist CFBundlePackageType does not match APPL" >&2; exit 1; }
[[ "$(cat "$pkginfo")" == "APPL????" ]] || { echo "PkgInfo does not match APPL????" >&2; exit 1; }
grep -q 'unsigned smoke artifact' "$readme" || { echo "handoff README does not identify an unsigned smoke artifact" >&2; exit 1; }
packaging/check-bundle-manifest.sh "$bundle_dir" "$manifest" "macos-appkit" "a3s-gui-dogfood-macos"
echo "validated $bundle_dir"
# Stage the Linux GTK4 dogfood filesystem bundle
bundle-gtk4:
#!/usr/bin/env bash
set -euo pipefail
if [[ "$(uname -s)" != "Linux" ]]; then
echo "bundle-gtk4 must run on Linux" >&2
exit 1
fi
cargo build --locked --release --features gtk4-native --example gtk4_dogfood
bundle_dir="target/release/bundle/a3s-gui-dogfood-linux"
rm -rf "$bundle_dir"
mkdir -p "$bundle_dir/usr/bin" "$bundle_dir/usr/share/applications"
cp target/release/examples/gtk4_dogfood "$bundle_dir/usr/bin/a3s-gui-dogfood"
cp packaging/linux/a3s-gui-dogfood.desktop "$bundle_dir/usr/share/applications/a3s-gui-dogfood.desktop"
cp packaging/a3s-gui-dogfood-README.txt "$bundle_dir/README.txt"
chmod +x "$bundle_dir/usr/bin/a3s-gui-dogfood"
packaging/write-bundle-manifest.sh "$bundle_dir" "$bundle_dir/MANIFEST.txt" "linux-gtk4" "a3s-gui-dogfood-linux"
echo "staged $bundle_dir"
# Validate the staged Linux GTK4 dogfood filesystem bundle
check-bundle-gtk4:
#!/usr/bin/env bash
set -euo pipefail
if [[ "$(uname -s)" != "Linux" ]]; then
echo "check-bundle-gtk4 must run on Linux" >&2
exit 1
fi
bundle_dir="target/release/bundle/a3s-gui-dogfood-linux"
binary="$bundle_dir/usr/bin/a3s-gui-dogfood"
desktop="$bundle_dir/usr/share/applications/a3s-gui-dogfood.desktop"
readme="$bundle_dir/README.txt"
manifest="$bundle_dir/MANIFEST.txt"
[[ -x "$binary" ]] || { echo "missing executable GTK4 dogfood binary: $binary" >&2; exit 1; }
[[ -f "$desktop" ]] || { echo "missing desktop entry: $desktop" >&2; exit 1; }
[[ -f "$readme" ]] || { echo "missing GTK4 handoff README: $readme" >&2; exit 1; }
[[ -f "$manifest" ]] || { echo "missing GTK4 bundle manifest: $manifest" >&2; exit 1; }
grep -qx 'Type=Application' "$desktop" || { echo "desktop entry Type is not Application" >&2; exit 1; }
grep -qx 'Name=A3S GUI Dogfood' "$desktop" || { echo "desktop entry Name does not match A3S GUI Dogfood" >&2; exit 1; }
grep -qx 'Exec=a3s-gui-dogfood' "$desktop" || { echo "desktop entry Exec does not match a3s-gui-dogfood" >&2; exit 1; }
grep -q 'unsigned smoke artifact' "$readme" || { echo "handoff README does not identify an unsigned smoke artifact" >&2; exit 1; }
packaging/check-bundle-manifest.sh "$bundle_dir" "$manifest" "linux-gtk4" "a3s-gui-dogfood-linux"
echo "validated $bundle_dir"
# Stage the Windows WinUI dogfood bundle
bundle-winui:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*|Windows_NT)
;;
*)
echo "bundle-winui must run on Windows with the MSVC toolchain" >&2
exit 1
;;
esac
cargo build --locked --release --target x86_64-pc-windows-msvc --features winui-native --example winui_dogfood
bundle_dir="target/release/bundle/a3s-gui-dogfood-windows"
rm -rf "$bundle_dir"
mkdir -p "$bundle_dir"
cp target/x86_64-pc-windows-msvc/release/examples/winui_dogfood.exe "$bundle_dir/A3SGuiDogfood.exe"
cp packaging/windows/a3s-gui-dogfood.manifest "$bundle_dir/A3SGuiDogfood.exe.manifest"
cp packaging/a3s-gui-dogfood-README.txt "$bundle_dir/README.txt"
packaging/write-bundle-manifest.sh "$bundle_dir" "$bundle_dir/MANIFEST.txt" "windows-winui" "a3s-gui-dogfood-windows"
echo "staged $bundle_dir"
# Validate the staged Windows WinUI dogfood bundle
check-bundle-winui:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*|Windows_NT)
;;
*)
echo "check-bundle-winui must run on Windows with the MSVC toolchain" >&2
exit 1
;;
esac
bundle_dir="target/release/bundle/a3s-gui-dogfood-windows"
binary="$bundle_dir/A3SGuiDogfood.exe"
manifest="$bundle_dir/A3SGuiDogfood.exe.manifest"
readme="$bundle_dir/README.txt"
bundle_manifest="$bundle_dir/MANIFEST.txt"
[[ -s "$binary" ]] || { echo "missing WinUI dogfood executable: $binary" >&2; exit 1; }
[[ -f "$manifest" ]] || { echo "missing WinUI dogfood manifest: $manifest" >&2; exit 1; }
[[ -f "$readme" ]] || { echo "missing WinUI handoff README: $readme" >&2; exit 1; }
[[ -f "$bundle_manifest" ]] || { echo "missing WinUI bundle manifest: $bundle_manifest" >&2; exit 1; }
grep -q 'name="A3S.GUI.Dogfood"' "$manifest" || { echo "manifest assembly identity does not match A3S.GUI.Dogfood" >&2; exit 1; }
grep -q '<dpiAwareness' "$manifest" || { echo "manifest is missing dpiAwareness" >&2; exit 1; }
grep -q 'unsigned smoke artifact' "$readme" || { echo "handoff README does not identify an unsigned smoke artifact" >&2; exit 1; }
packaging/check-bundle-manifest.sh "$bundle_dir" "$bundle_manifest" "windows-winui" "a3s-gui-dogfood-windows"
echo "validated $bundle_dir"
# Check all planning adapters without native OS bindings
check-platforms:
cargo check --locked --all-targets --features appkit,winui,gtk4
# Check the native backend that matches this operating system
check-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo check --locked --all-targets --features appkit-native
;;
Linux)
cargo check --locked --all-targets --features gtk4-native
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo check --locked --all-targets --features winui-native
;;
*)
echo "unsupported operating system for native GUI checks: $(uname -s)" >&2
exit 1
;;
esac
# Check the Windows dogfood target from any host with the target installed
check-winui:
cargo check --locked --all-targets --target x86_64-pc-windows-msvc --features winui-native
# ============================================================================
# Test
# ============================================================================
# Run the default Rust test suite
test:
cargo test --locked
# Run protocol and native runtime examples as tests
test-examples:
cargo test --locked --examples
# Run adapter planning tests without native OS bindings
test-platforms:
cargo test --locked --features appkit,winui,gtk4
# Prove the runtime core builds without SWC or the built-in design system
check-core:
cargo check --locked --no-default-features --lib
cargo check --locked --no-default-features --features authoring --lib
# Run native-feature library tests for this operating system
test-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo test --locked --lib --features appkit-native
;;
Linux)
cargo test --locked --lib --features gtk4-native
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo test --locked --lib --features winui-native
;;
*)
echo "unsupported operating system for native GUI tests: $(uname -s)" >&2
exit 1
;;
esac
# Run the complete host-native CI gate locally
native-ci: test-native check-native
# Print the required native input automation matrix for one backend
native-input-manifest BACKEND:
cargo run --locked --quiet --bin a3s-gui-native-input-conformance -- manifest "{{ BACKEND }}"
# Strictly verify an operating-system automation evidence artifact
native-input-conformance EVIDENCE:
cargo run --locked --quiet --bin a3s-gui-native-input-conformance -- verify "{{ EVIDENCE }}"
# Capture the complete 98-case WinUI OS-input smoke artifact
winui-input-smoke EVIDENCE:
cargo run --locked --quiet --no-default-features --features winui-native --bin a3s-gui-winui-input-smoke -- "{{ EVIDENCE }}"
# Lint every target and deny high-confidence Clippy and Rust warnings
clippy:
cargo clippy --locked --all-targets --features appkit,winui,gtk4 -- -A clippy::all -D clippy::correctness -D clippy::suspicious -A clippy::unnecessary_get_then_check -D unused
# Build crate documentation and fail on rustdoc warnings
doc-check:
RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps --document-private-items
# Run the full local verification suite
verify: fmt-check check-core clippy doc-check test test-examples test-platforms diff-check
# Run dogfood reducer and protocol-boundary regression tests
dogfood-regression:
cargo test --locked --example dogfood_session -- --nocapture
# Run one Rust test filter with output
test-one TEST:
cargo test --locked {{ TEST }} -- --nocapture
# ============================================================================
# Formatting
# ============================================================================
# Format Rust code
fmt:
cargo fmt --all
# Check Rust formatting
fmt-check:
cargo fmt --all --check
# Check whitespace in the current git diff
diff-check:
git diff --check
# ============================================================================
# Examples
# ============================================================================
# Run the headless dogfood session
dogfood:
cargo run --locked --example dogfood_session
# Run the native dogfood app for this operating system
dogfood-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo run --locked --features appkit-native --example appkit_dogfood
;;
Linux)
cargo run --locked --features gtk4-native --example gtk4_dogfood
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo run --locked --features winui-native --example winui_dogfood
;;
*)
echo "unsupported operating system for native GUI dogfood: $(uname -s)" >&2
exit 1
;;
esac
# Run the native controls smoke app for this operating system
controls-native:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo run --locked --features appkit-native --example appkit_controls
;;
Linux)
cargo run --locked --features gtk4-native --example gtk4_controls
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo run --locked --features winui-native --example winui_controls
;;
*)
echo "unsupported operating system for native GUI controls: $(uname -s)" >&2
exit 1
;;
esac
# Run the native calculator app for this operating system
calculator:
cargo run --locked --features {{ native-backend }}-native --example {{ native-backend }}_calculator
# Run the native semantic component playground for this operating system
playground:
#!/usr/bin/env bash
set -euo pipefail
case "$(uname -s)" in
Darwin)
cargo run --locked --features appkit-native --example appkit_component_playground
;;
Linux)
cargo run --locked --features gtk4-native --example gtk4_component_playground
;;
MINGW*|MSYS*|CYGWIN*|Windows_NT)
cargo run --locked --features winui-native --example winui_component_playground
;;
*)
echo "unsupported operating system for native GUI component playground: $(uname -s)" >&2
exit 1
;;
esac