SPB Git

Repository Public

build.sh 1.6 KB 20 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")/.."9DD="build/DerivedData"10filter() { grep -v "\[Connection\]" | 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; }11case "${1:-debug}" in12  generate) xcodegen generate --quiet && echo "SPChat.xcodeproj generated" ;;13  debug)    xcodegen generate --quiet; xcodebuild -project SPChat.xcodeproj -scheme SPChat -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' build 2>&1 | filter ;;14  core-test) swift test 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "✘|error:|Test run with|recorded an issue" || true ;;15  app-test) xcodegen generate --quiet; xcodebuild -project SPChat.xcodeproj -scheme SPChat -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' test 2>&1 | filter ;;16  ui-test)  xcodegen generate --quiet; shift; xcodebuild -project SPChat.xcodeproj -scheme SPChatUITests -configuration Debug -derivedDataPath "$DD" -destination 'platform=macOS,arch=arm64' test "$@" 2>&1 | filter ;;17  run)      shift; open -n "$DD/Build/Products/Debug/SP Chat.app" --args "$@" ;;18  *) echo "usage: $0 generate|debug|core-test|app-test|ui-test|run" >&2; exit 2 ;;19esac20
Files main
Menu

Theme