-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-app.sh
More file actions
executable file
·27 lines (21 loc) · 889 Bytes
/
Copy pathbuild-app.sh
File metadata and controls
executable file
·27 lines (21 loc) · 889 Bytes
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
#!/usr/bin/env bash
# Build a self-contained "Move Display.app" bundle from the SwiftPM build output.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
APP_NAME="Move Display"
BUNDLE_ID="local.movedisplay.app"
BUILD_DIR="$ROOT/.build/release"
APP_DIR="$ROOT/build/${APP_NAME}.app"
echo "==> Building release binary"
swift build -c release --package-path "$ROOT"
echo "==> Assembling .app bundle at $APP_DIR"
rm -rf "$APP_DIR"
mkdir -p "$APP_DIR/Contents/MacOS"
mkdir -p "$APP_DIR/Contents/Resources"
cp "$BUILD_DIR/MoveDisplay" "$APP_DIR/Contents/MacOS/MoveDisplay"
cp "$ROOT/Resources/Info.plist" "$APP_DIR/Contents/Info.plist"
# Ad-hoc sign so Gatekeeper / TCC are happy on first launch.
codesign --force --deep --sign - "$APP_DIR" >/dev/null
echo "==> Done: $APP_DIR"
echo "Run it with: open \"$APP_DIR\""
echo "Or copy to /Applications: cp -R \"$APP_DIR\" /Applications/"