diff options
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 50 |
1 files changed, 47 insertions, 3 deletions
@@ -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 |