SPB Git

Repository Public License

build.sh 2.9 KB 68 lines shellscript

1#!/usr/bin/env bash2# Builds the executables and wraps them into .app bundles under build/ (ADR 0001).3#   scripts/build.sh [debug|release]      default: debug4# Bundles are signed ad hoc here; scripts/package.sh re-signs with a Developer ID for distribution.5set -euo pipefail6cd "$(dirname "$0")/.."7CONFIG="${1:-debug}"8VERSION="$(cat VERSION 2>/dev/null || echo 0.1.0)"9BUILD_NUMBER="$(git rev-list --count HEAD 2>/dev/null || echo 1)"10MIN_OS="26.0"11OUT="build/$CONFIG"1213swift build -c "$CONFIG" --product PrismSatelliteHost14swift build -c "$CONFIG" --product PRISM15swift build -c "$CONFIG" --product prism-cli16BIN="$(swift build -c "$CONFIG" --show-bin-path)"1718plist() { # path, executable, bundle id, display name19  cat > "$1" <<PLIST20<?xml version="1.0" encoding="UTF-8"?>21<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">22<plist version="1.0">23<dict>24  <key>CFBundleDevelopmentRegion</key><string>en</string>25  <key>CFBundleExecutable</key><string>$2</string>26  <key>CFBundleIdentifier</key><string>$3</string>27  <key>CFBundleName</key><string>$4</string>28  <key>CFBundleDisplayName</key><string>$4</string>29  <key>CFBundleIconFile</key><string>AppIcon</string>30  <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>31  <key>CFBundlePackageType</key><string>APPL</string>32  <key>CFBundleShortVersionString</key><string>$VERSION</string>33  <key>CFBundleVersion</key><string>$BUILD_NUMBER</string>34  <key>LSMinimumSystemVersion</key><string>$MIN_OS</string>35  <key>LSApplicationCategoryType</key><string>public.app-category.developer-tools</string>36  <key>NSHighResolutionCapable</key><true/>37  <key>NSPrincipalClass</key><string>NSApplication</string>38  <key>NSHumanReadableCopyright</key><string>© 2026 Simon-Pierre Boucher</string>39</dict>40</plist>41PLIST42}4344rm -rf "$OUT"45mkdir -p "$OUT"4647# 1. The satellite host template.48HOST="$OUT/PrismSatelliteHost.app"49mkdir -p "$HOST/Contents/MacOS" "$HOST/Contents/Resources"50cp "$BIN/PrismSatelliteHost" "$HOST/Contents/MacOS/PrismSatelliteHost"51plist "$HOST/Contents/Info.plist" PrismSatelliteHost ai.spboucher.prism.satellite.host "PRISM App"52"$BIN/prism-cli" icon "PRISM App" "$HOST/Contents/Resources/AppIcon.icns"53codesign --force --sign - --timestamp=none "$HOST"5455# 2. PRISM itself, carrying the host template and the templates.56APP="$OUT/PRISM.app"57mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"58cp "$BIN/PRISM" "$APP/Contents/MacOS/PRISM"59plist "$APP/Contents/Info.plist" PRISM ai.spboucher.prism PRISM60"$BIN/prism-cli" icon-spec assets/prism-icon.json "$APP/Contents/Resources/AppIcon.icns"61cp -R "$HOST" "$APP/Contents/Resources/SatelliteHost.app"62cp -R templates "$APP/Contents/Resources/templates"63codesign --force --sign - --timestamp=none "$APP/Contents/Resources/SatelliteHost.app"64codesign --force --sign - --timestamp=none "$APP"65codesign --verify --deep --strict "$APP"6667echo "Built $APP and $HOST ($CONFIG, version $VERSION build $BUILD_NUMBER)"68
Files main
Menu

Theme