SPB Git

Repository Public

build.sh 3.7 KB 70 lines shellscript

1#!/usr/bin/env bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : MacLustr SMS Gateway8# File             : ios/Scripts/build.sh9# Description      : Generate the Xcode project, build, test (filtered10#                    xcodebuild output; full log in build/logs).11# Module           : ios12# Repository       : https://git.spboucher.ai/maclustr-sms13# Project Website  : https://sms.spboucher.ai14# Created          : 2026-11-3015# Last Modified    : 2026-11-3016#17# Author           : Simon-Pierre Boucher18# Position         : Professor of Finance19# Institution      : Université du Québec en Outaouais (UQO)20# Organization     : SP Boucher21# Website          : https://spboucher.ai22# Git              : https://git.spboucher.ai23#24# Preferred Contact: admin@spboucher.ai25# Technical Contact: dev@spboucher.ai26# Security/Admin   : admin@spboucher.ai27#28# Copyright (c) 202629# Simon-Pierre Boucher30# All rights reserved where applicable. This file is governed by the31# applicable project license, copyright notices and relevant law.32# Existing third-party rights and notices remain unaffected.33#34# License          : None specified (no license file in this repository)35#36# Do not embed credentials, private keys, access tokens,37# certificates or confidential personal information.38#39# =============================================================================40# END OF SP BOUCHER SOURCE HEADER41# =============================================================================4243set -uo pipefail44cd "$(dirname "$0")/.."45SIM="${MLSMS_SIM:-MLSMS iPhone}"46DD="${MLSMS_DD:-build/DerivedData}"47mkdir -p build/logs48filter() { grep -E "error:|warning: unre|warning: var|\*\* |Test Suite .* (passed|failed)|Executed [0-9]+ tests|✘|✔|Testing failed|failed \(|: error" | grep -v "^$" | sort -u | head -${LINES_MAX:-60}; }49case "${1:-debug}" in50  generate)51    # Info-Debug.plist = Info.plist + local networking allowed (pile locale de mise au point)52    cp MacLustrSMS/Resources/Info.plist MacLustrSMS/Resources/Info-Debug.plist53    /usr/libexec/PlistBuddy -c "Set :NSAppTransportSecurity:NSAllowsLocalNetworking true" MacLustrSMS/Resources/Info-Debug.plist54    xcodegen generate --quiet && echo "projet généré" ;;55  debug)56    xcodebuild -project MacLustrSMS.xcodeproj -scheme MacLustrSMS -configuration Debug -destination "platform=iOS Simulator,name=$SIM" -derivedDataPath "$DD" build 2>&1 | tee build/logs/debug.log | filter ;;57  release)58    xcodebuild -project MacLustrSMS.xcodeproj -scheme MacLustrSMS -configuration Release -destination "generic/platform=iOS Simulator" -derivedDataPath "$DD" build 2>&1 | tee build/logs/release.log | filter ;;59  test)60    shift || true61    xcodebuild -project MacLustrSMS.xcodeproj -scheme MacLustrSMS -destination "platform=iOS Simulator,name=$SIM" -derivedDataPath "$DD" -only-testing:MacLustrSMSTests "$@" test 2>&1 | tee build/logs/test.log | filter ;;62  uitest)63    shift || true64    rm -rf "build/results/uitest-${SIM// /_}.xcresult"65    xcodebuild -project MacLustrSMS.xcodeproj -scheme MacLustrSMS -destination "platform=iOS Simulator,name=$SIM" -derivedDataPath "$DD" -only-testing:MacLustrSMSUITests -resultBundlePath "build/results/uitest-${SIM// /_}.xcresult" "$@" test 2>&1 | tee build/logs/uitest.log | filter66    rm -rf "build/shots/${SIM// /_}"; mkdir -p "build/shots/${SIM// /_}"67    xcrun xcresulttool export attachments --path "build/results/uitest-${SIM// /_}.xcresult" --output-path "build/shots/${SIM// /_}" >/dev/null 2>&1 || true ;;68  *) echo "usage: build.sh generate|debug|release|test|uitest"; exit 2 ;;69esac70
Files main
Menu

Theme