Repository Public
1#!/bin/bash2# Generates the Xcode project and builds the iOS app for the simulator.3# Scripts/build.sh [Debug|Release] (default Debug; a Release simulator build is unsigned — see release.sh)4# Environment: MCC_DERIVED_DATA (default /tmp/mcc-ios/DerivedData) — keep it OUTSIDE ~/Desktop.5set -euo pipefail6cd "$(dirname "$0")/.."7CONFIG="${1:-Debug}"8DD="${MCC_DERIVED_DATA:-/tmp/mcc-ios/DerivedData}"9# The project is generated next to the derived data, not in the sources: concurrent builds do not step on each other.10PROJ="$DD.project"11mkdir -p "$PROJ"12xcodegen generate --quiet --spec project.yml --project "$PROJ" --project-root .13set -o pipefail14xcodebuild -project "$PROJ/MCCiOS.xcodeproj" -scheme MCCiOS -configuration "$CONFIG" -derivedDataPath "$DD" \15 -destination 'generic/platform=iOS Simulator' -skipPackagePluginValidation -skipMacroValidation MCC_ROOT="$PWD" \16 ${MCC_BUILD_ACTION:-build} 2>&1 | tee "$DD.build.log" \17 | grep -E "^/.*(error|warning: unre)|error:|BUILD (SUCCEEDED|FAILED)" | grep -v "^\s*$" | sed -E "s|$PWD/||" | sort -u || true18grep -q "BUILD SUCCEEDED" "$DD.build.log"19echo "$DD/Build/Products/$CONFIG-iphonesimulator/MacLustr.app"20