-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_app.sh
More file actions
executable file
Β·46 lines (36 loc) Β· 1.1 KB
/
build_app.sh
File metadata and controls
executable file
Β·46 lines (36 loc) Β· 1.1 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
.#!/bin/bash
APP_NAME="VolumeSync"
BUILD_DIR=".build/release"
OUTPUT_DIR="dist"
APP_BUNDLE="${OUTPUT_DIR}/${APP_NAME}.app"
echo "π Building ${APP_NAME}..."
swift build -c release
if [ $? -ne 0 ]; then
echo "β Build failed."
exit 1
fi
echo "π¦ Creating App Bundle..."
mkdir -p "${APP_BUNDLE}/Contents/MacOS"
mkdir -p "${APP_BUNDLE}/Contents/Resources"
# Copy Binary
cp "${BUILD_DIR}/${APP_NAME}" "${APP_BUNDLE}/Contents/MacOS/"
# Copy Info.plist
cp "Info.plist" "${APP_BUNDLE}/Contents/Info.plist"
# Generate Icon if source exists
if [ -f "AppIconSource.png" ]; then
if [ ! -f "AppIcon.icns" ]; then
echo "π¨ Generating AppIcon.icns..."
chmod +x create_icns.sh
./create_icns.sh
fi
fi
# Copy Icon
if [ -f "AppIcon.icns" ]; then
echo "π¨ Copying Icon..."
cp "AppIcon.icns" "${APP_BUNDLE}/Contents/Resources/AppIcon.icns"
fi
echo "π Signing (Ad-Hoc)..."
# To sign for App Store, you would use: --sign "Apple Distribution: ..."
codesign --force --deep --sign - "${APP_BUNDLE}"
echo "β
Done! App is at ${APP_BUNDLE}"
echo "You can move this to /Applications"