SPB Git

Repository Public

build.sh 1.8 KB 22 lines shellscript

1#!/usr/bin/env bash2# Author: Simon-Pierre Boucher — contact@spboucher.ai3# File: Scripts/build.sh4# Description: Development entry point: generate the Xcode project, build Debug, run core / app / UI tests, launch the app.5#6# Usage: Scripts/build.sh generate|debug|core-test|app-test|ui-test|run [args…]7set -euo pipefail8cd "$(dirname "$0")/.."9# Debug products live outside ~/Desktop: a sandboxed test host that dyld-loads a package framework from the Desktop folder waits for a10# privacy (TCC) decision nobody can give ("The test runner hung before establishing connection").11DD="${SPNOTES_DD:-$HOME/Library/Developer/SPNotes/DerivedData}"12filter() { grep -E "error:|warning: unre|\*\* BUILD|\*\* TEST|Test Suite .* (passed|failed)|Executed|✘|Test run with|recorded an issue|failed after" | sed 's/\x1b\[[0-9;]*m//g' | sort -u | head -${LINES_MAX:-60} || true; }13case "${1:-debug}" in14  generate) xcodegen generate --quiet && echo "SPNotes.xcodeproj generated" ;;15  debug)    xcodegen generate --quiet; xcodebuild -project SPNotes.xcodeproj -scheme SPNotes -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' build  2>&1 | filter ;;16  core-test) swift test 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "✘|error:|Test run with|recorded an issue" || true ;;17  app-test) xcodegen generate --quiet; xcodebuild -project SPNotes.xcodeproj -scheme SPNotes -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' test 2>&1 | filter ;;18  ui-test)  xcodegen generate --quiet; shift; xcodebuild -project SPNotes.xcodeproj -scheme SPNotesUITests -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' test "$@" 2>&1 | filter ;;19  run)      shift; open -g -n "$DD/Build/Products/Debug/SP Notes.app" --args "$@" ;;20  *) echo "usage: $0 generate|debug|core-test|app-test|ui-test|run" >&2; exit 2 ;;21esac22
Files main
Menu

Theme