#!/bin/sh set -eu cd "$(dirname "$0")/.." if [ "${OFICINA_SKIP_PROJECT_GENERATION:-0}" != 1 ]; then xcodegen generate --spec ios/project.yml; fi case "${1:-simulator}" in simulator) xcodebuild -project ios/SheetsPhone.xcodeproj -scheme SheetsPhone -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath build/ios CODE_SIGNING_ALLOWED=NO build ;; device) : "${OFICINA_DEVELOPMENT_TEAM:?Set your Apple development team ID}" xcodebuild -project ios/SheetsPhone.xcodeproj -scheme SheetsPhone -destination 'generic/platform=iOS' -derivedDataPath build/device "DEVELOPMENT_TEAM=$OFICINA_DEVELOPMENT_TEAM" -allowProvisioningUpdates build ;; *) exit 2 ;; esac