aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Jacobs2025-12-21 17:52:52 +0100
committerSan Jacobs2025-12-21 17:52:52 +0100
commit9d654ada668b9ae8a71a34904a65395238567973 (patch)
tree298a548322f9cfdbd06822219f548b1f47c119fe
parent1449997ba675dac55c9689e4780e0a0e177aec06 (diff)
downloadbetter-report-9d654ada668b9ae8a71a34904a65395238567973.tar.gz
better-report-9d654ada668b9ae8a71a34904a65395238567973.tar.bz2
better-report-9d654ada668b9ae8a71a34904a65395238567973.zip
Epic new build.sh for MacOS that makes .app bundlesHEADmaster
-rwxr-xr-xbuild.sh50
1 files changed, 47 insertions, 3 deletions
diff --git a/build.sh b/build.sh
index d5e8c38..678db80 100755
--- a/build.sh
+++ b/build.sh
@@ -1,4 +1,48 @@
-odin build src/ -resource:src/graphics/macos.rc -debug -pdb-name:bin/better-report.pdb -out:bin/better-report
-odin build src/ -resource:src/graphics/macos.rc -o:speed -out:bin/release/better-report
+mkdir -p bin/release
+odin build src/ -debug -out:bin/better-report
+odin build src/ -o:speed -out:bin/release/better-report
chmod +x bin/better-report
-chmod +x bin/release/better-report \ No newline at end of file
+chmod +x bin/release/better-report
+
+# Create macOS .app bundle
+APP_NAME="Better Report"
+APP_DIR="bin/release/${APP_NAME}.app"
+rm -rf "$APP_DIR"
+mkdir -p "$APP_DIR/Contents/MacOS"
+mkdir -p "$APP_DIR/Contents/Resources"
+
+cp bin/release/better-report "$APP_DIR/Contents/MacOS/better-report-bin"
+
+# Create launcher script that opens Terminal
+cat > "$APP_DIR/Contents/MacOS/better-report" << 'LAUNCHER'
+#!/bin/bash
+DIR="$(cd "$(dirname "$0")" && pwd)"
+osascript -e "tell application \"Terminal\" to do script \"'$DIR/better-report-bin'; exit\""
+LAUNCHER
+chmod +x "$APP_DIR/Contents/MacOS/better-report"
+
+# Copy icon
+cp src/graphics/logo.icns "$APP_DIR/Contents/Resources/AppIcon.icns"
+
+cat > "$APP_DIR/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>CFBundleExecutable</key>
+ <string>better-report</string>
+ <key>CFBundleIconFile</key>
+ <string>AppIcon</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.wassimulator.better-report</string>
+ <key>CFBundleName</key>
+ <string>Better Report</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+</dict>
+</plist>
+EOF