Repository Public
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | SOFTWARE & RESEARCH4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : SP ID & Card Vault8# File : scripts/build.sh9# Module : Scripts10# Repository : https://git.spboucher.ai/sp-id-card-vault11# Project Website : Not specified12# Created : 2026-12-0213# Last Modified : 2026-12-0214#15# Author : Simon-Pierre Boucher16# Position : Professor of Finance17# Institution : Université du Québec en Outaouais (UQO)18# Organization : SP Boucher19# Website : https://spboucher.ai20# Git : https://git.spboucher.ai21#22# Preferred Contact: contact@spboucher.ai23# Development : dev@spboucher.ai24# Support : support@spboucher.ai25# Security/Admin : admin@spboucher.ai26#27# Copyright (c) 202628# Simon-Pierre Boucher29# All rights reserved where applicable. This file is governed by the30# applicable project license, copyright notices and relevant law.31# Existing third-party rights and notices remain unaffected.32#33# License : None specified (no license file in this repository)34#35# Do not embed credentials, private keys, access tokens,36# certificates or confidential personal information.37#38# =============================================================================39# END OF SP BOUCHER SOURCE HEADER40# =============================================================================4142# Build and test entry points. usage: scripts/build.sh gen|debug|release|test|unit|uitest [extra xcodebuild args]43set -euo pipefail44cd "$(dirname "$0")/.."45SIM="${SPV_SIM:-SPVault iPhone}"46DD="${SPV_DD:-build/dd}"47DEST="platform=iOS Simulator,name=$SIM"48filter() { grep -E "error:|warning:|BUILD (SUCCEEDED|FAILED)|TEST (SUCCEEDED|FAILED)|Executed [0-9]+ tests|✘|failed \(|Test run with" | grep -v appintents | sort -u | tail -${SPV_LINES:-60}; }49cmd="${1:-debug}"; shift || true50case "$cmd" in51 gen) xcodegen generate ;;52 debug) xcodegen generate >/dev/null; xcodebuild -project SPVault.xcodeproj -scheme SPVault -configuration Debug -destination "$DEST" -derivedDataPath "$DD" build CODE_SIGNING_ALLOWED=NO "$@" 2>&1 | filter ;;53 release) xcodegen generate >/dev/null; xcodebuild -project SPVault.xcodeproj -scheme SPVault -configuration Release -destination "generic/platform=iOS" -derivedDataPath "$DD" build -allowProvisioningUpdates "$@" 2>&1 | filter ;;54 unit) xcodegen generate >/dev/null; xcodebuild -project SPVault.xcodeproj -scheme SPVault -destination "$DEST" -derivedDataPath "$DD" test -only-testing:SPVaultTests "$@" 2>&1 | filter ;;55 uitest) xcodegen generate >/dev/null; xcodebuild -project SPVault.xcodeproj -scheme SPVault -destination "$DEST" -derivedDataPath "$DD" test -only-testing:SPVaultUITests "$@" 2>&1 | filter ;;56 test) xcodegen generate >/dev/null; xcodebuild -project SPVault.xcodeproj -scheme SPVault -destination "$DEST" -derivedDataPath "$DD" test "$@" 2>&1 | filter ;;57 *) echo "usage: $0 gen|debug|release|test|unit|uitest"; exit 2 ;;58esac59