-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·53 lines (45 loc) · 1.82 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.82 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
#!/bin/bash
set -e
cd "$(dirname "$0")"
APP="VideoGrab.app"
BIN_NAME="VideoGrab"
echo "→ Building $APP …"
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
swiftc -O -parse-as-library \
Sources/VideoGrab/*.swift \
-framework SwiftUI -framework AppKit \
-o "$APP/Contents/MacOS/$BIN_NAME"
# Generate icons if missing, then bundle them.
if [ ! -f "VideoGrab.icns" ]; then
bash tools/make_icons.sh
fi
cp "VideoGrab.icns" "$APP/Contents/Resources/AppIcon.icns"
cat > "$APP/Contents/Info.plist" <<'PLIST'
<?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>CFBundleExecutable</key> <string>VideoGrab</string>
<key>CFBundleIdentifier</key> <string>com.local.videograb</string>
<key>CFBundleName</key> <string>VideoGrab</string>
<key>CFBundleDisplayName</key> <string>VideoGrab</string>
<key>CFBundleVersion</key> <string>1.0</string>
<key>CFBundleShortVersionString</key> <string>1.0</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleIconFile</key> <string>AppIcon</string>
<key>CFBundleIconName</key> <string>AppIcon</string>
<key>LSMinimumSystemVersion</key> <string>13.0</string>
<key>NSHighResolutionCapable</key> <true/>
<key>LSUIElement</key> <false/>
<key>NSAppTransportSecurity</key>
<dict><key>NSAllowsArbitraryLoads</key><true/></dict>
</dict>
</plist>
PLIST
# Ad-hoc sign so Gatekeeper accepts launching it locally
codesign --force --deep --sign - "$APP" >/dev/null 2>&1 || true
echo "✓ Built $(pwd)/$APP"
echo ""
echo "Run it: open $APP"
echo "Or move: mv $APP /Applications/"