SPB Git

Repository Public License

build.sh 1.4 KB 33 lines shellscript

1#!/usr/bin/env bash2# ORIX Arcade3# File: Scripts/build.sh4# Description: Generate the Xcode project and build or test on a simulator.5#              usage: build.sh generate | build | test [-only-testing:…] | uitest6#              env: ORIX_SIM (simulator name, default "ORIXArcade iPhone"), ORIX_DD (derived data dir)7#8# Author: Simon-Pierre Boucher9# Contact: contact@spboucher.ai10set -euo pipefail11cd "$(dirname "$0")/.."12SIM="${ORIX_SIM:-ORIXArcade iPhone}"13DD="${ORIX_DD:-build/DerivedData}"14mkdir -p build/logs15step="${1:-build}"; shift || true16xcodegen generate --quiet17xcrun simctl list devices | grep -q "$SIM (" || xcrun simctl create "$SIM" "iPhone 17 Pro" >/dev/null18DEST="platform=iOS Simulator,name=$SIM"19run() { # logname, args…20  local log="build/logs/$1.log"; shift21  if ! xcodebuild -project ORIXArcade.xcodeproj -scheme ORIXArcade -destination "$DEST" -derivedDataPath "$DD" "$@" > "$log" 2>&1; then22    grep -E "error:|failed|\*\* " "$log" | sort -u | head -40; echo "log: $log"; exit 123  fi24  grep -E "Executed [0-9]+ tests|\*\* " "$log" | tail -425}26case "$step" in27generate) ;;28build) run build build "$@" ;;29test) xcrun simctl bootstatus "$SIM" -b >/dev/null; run test test -only-testing:ORIXArcadeTests "$@" ;;30uitest) xcrun simctl bootstatus "$SIM" -b >/dev/null; run uitest test -only-testing:ORIXArcadeUITests "$@" ;;31*) echo "unknown step: $step"; exit 2 ;;32esac33
Files main
Menu

Theme