-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (34 loc) · 1.55 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·39 lines (34 loc) · 1.55 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
#!/bin/zsh
# Builds Echo.app from EchoApp.swift. No Xcode project needed - just swiftc.
set -e
cd "$(dirname "$0")"
APP_NAME="${APP_NAME:-Echo}"
BUNDLE_ID="${BUNDLE_ID:-local.echo}"
SIGN_ID="${SIGN_ID:--}" # "-" = ad-hoc; see README about TCC and self-signed certs
swiftc -O -target arm64-apple-macos14.4 -parse-as-library EchoApp.swift -o /tmp/echo_build
APP="$APP_NAME.app"
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS"
cp /tmp/echo_build "$APP/Contents/MacOS/$APP_NAME"
chmod +x "$APP/Contents/MacOS/$APP_NAME"
cat > "$APP/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key><string>$BUNDLE_ID</string>
<key>CFBundleName</key><string>$APP_NAME</string>
<key>CFBundleDisplayName</key><string>$APP_NAME</string>
<key>CFBundleExecutable</key><string>$APP_NAME</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleVersion</key><string>1.0</string>
<key>CFBundleShortVersionString</key><string>1.0</string>
<key>LSMinimumSystemVersion</key><string>14.4</string>
<key>NSHighResolutionCapable</key><true/>
<key>NSMicrophoneUsageDescription</key><string>Recording the microphone track for meeting transcription</string>
</dict>
</plist>
EOF
codesign --force --deep --identifier "$BUNDLE_ID" -s "$SIGN_ID" "$APP"
echo "Built $APP (bundle id $BUNDLE_ID, signed: $SIGN_ID)"
echo "Grant Microphone + Screen & System Audio Recording in System Settings, then relaunch the app."