#!/bin/sh # Builds Orgstar.app in .build/app from the release binary, signed ad hoc for local use. # Usage: scripts/build-app.sh [version] set -eu cd "$(dirname "$0")/.." version="${1:-0.1.0}" app=".build/app/Orgstar.app" swift build -c release --product Orgstar binary="$(swift build -c release --show-bin-path)/Orgstar" rm -rf "$app" mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources" cp "$binary" "$app/Contents/MacOS/Orgstar" cat > "$app/Contents/Info.plist" < CFBundleIdentifier sh.krz.orgstar CFBundleName Orgstar CFBundleDisplayName Orgstar CFBundleExecutable Orgstar CFBundlePackageType APPL CFBundleShortVersionString ${version} CFBundleVersion ${version} LSMinimumSystemVersion 26.0 LSApplicationCategoryType public.app-category.productivity NSHighResolutionCapable NSPrincipalClass NSApplication EOF codesign --force --sign - "$app" echo "$app"