Four targets (MWBCore, MWBNet, MWBMac, mwb) with a layering test that keeps MWBCore free of AppKit/CoreGraphics/Network; tools/gates.sh as the definition of done; tools/bundle.sh producing a signed dist/mwb.app; tools/lane.sh for lane worktrees; smoke binary with --version and --check-permissions. docs/loop.md records the Dev -> QA -> lead loop with the literal dispatch prompts, the wave schedule and escalations. Co-Authored-By: Claude Fable 5.1 <[email protected]>
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Release build → dist/mwb.app, signed.
|
|
#
|
|
# Usage: MWB_SIGN_IDENTITY="mwb-mac dev" tools/bundle.sh
|
|
# MWB_ADHOC=1 tools/bundle.sh # ad-hoc signature, for a throwaway build only
|
|
#
|
|
# A stable signing identity matters: macOS TCC ties the Accessibility and
|
|
# Input Monitoring grants to the code signature, and an ad-hoc signature
|
|
# changes with every build, so the user would be re-prompted each time
|
|
# (README D5). Create a self-signed identity once with Keychain Access
|
|
# (Certificate Assistant > Create a Certificate, type "Code Signing") and
|
|
# pass its name via MWB_SIGN_IDENTITY.
|
|
set -euo pipefail
|
|
root=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$root"
|
|
|
|
app="dist/mwb.app"
|
|
identity="${MWB_SIGN_IDENTITY:-}"
|
|
if [ -z "$identity" ]; then
|
|
if [ "${MWB_ADHOC:-0}" = 1 ]; then
|
|
identity="-"
|
|
echo "bundle.sh: ad-hoc signing (MWB_ADHOC=1); TCC grants will not persist across builds" >&2
|
|
else
|
|
echo "bundle.sh: set MWB_SIGN_IDENTITY to a code-signing identity, or MWB_ADHOC=1 for a throwaway build" >&2
|
|
exit 2
|
|
fi
|
|
fi
|
|
|
|
swift build -c release 2>&1 | grep -v '^\[' || true
|
|
swift build -c release >/dev/null
|
|
bin=$(swift build -c release --show-bin-path)/mwb
|
|
|
|
rm -rf "$app"
|
|
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
|
|
cp "$bin" "$app/Contents/MacOS/mwb"
|
|
cp Resources/Info.plist "$app/Contents/Info.plist"
|
|
codesign --force --sign "$identity" --options runtime --timestamp=none "$app"
|
|
codesign --verify --verbose=2 "$app"
|
|
echo "built $app"
|