-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·48 lines (41 loc) · 1.17 KB
/
build.sh
File metadata and controls
executable file
·48 lines (41 loc) · 1.17 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
#!/bin/bash
# FreeDisplay — Build & Package Script
# Usage: ./build.sh
# Output: build/FreeDisplay.dmg
set -e
PROJECT_ROOT="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="$PROJECT_ROOT/build"
ARCHIVE_PATH="$BUILD_DIR/FreeDisplay.xcarchive"
APP_EXPORT_DIR="$BUILD_DIR/export"
APP_PATH="$APP_EXPORT_DIR/FreeDisplay.app"
DMG_PATH="$BUILD_DIR/FreeDisplay.dmg"
echo "==> Cleaning build dir…"
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
echo "==> Archiving (Release)…"
xcodebuild \
-scheme FreeDisplay \
-configuration Release \
archive \
-archivePath "$ARCHIVE_PATH" \
| grep -E "error:|warning:|Build succeeded|** ARCHIVE"
echo "==> Exporting .app…"
xcodebuild \
-exportArchive \
-archivePath "$ARCHIVE_PATH" \
-exportPath "$APP_EXPORT_DIR" \
-exportOptionsPlist "$PROJECT_ROOT/ExportOptions.plist" \
| grep -E "error:|Export succeeded"
echo "==> Creating DMG…"
hdiutil create \
-volname "FreeDisplay" \
-srcfolder "$APP_PATH" \
-ov \
-format UDZO \
"$DMG_PATH"
echo ""
echo "Done! Output:"
echo " App: $APP_PATH"
echo " DMG: $DMG_PATH"
echo ""
echo "Note: App is unsigned. Users must right-click → Open to bypass Gatekeeper."