#!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." IFS= read -r want < .xcode-version xcode=$(xcodebuild -version) swift_version=$(swift --version) printf '%s\n%s\n' "$xcode" "$swift_version" if ! grep -Fxq "Xcode $want" <<< "$xcode"; then printf 'Need Xcode %s; select it with xcode-select or DEVELOPER_DIR.\n' "$want" >&2 exit 1 fi if ! grep -Eq 'Swift version 6\.2\.' <<< "$swift_version"; then printf 'Need the Swift 6.2 toolchain shipped with the pinned Xcode.\n' >&2 exit 1 fi for tool in mise lefthook shellcheck actionlint zizmor gitleaks gh; do command -v "$tool" >/dev/null || { printf 'Missing %s; run mise run setup.\n' "$tool" >&2; exit 1; } done Scripts/swift-build.sh --prepare printf 'Xcode, Swift, and development tools are ready.\n'