Groundroom / app / tools / check.sh
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | cd "$(dirname "$0")/.." |
| 4 | out="${1:-.check-build}" |
| 5 | mkdir -p "$out/tmp" "$out/modules" |
| 6 | out="$(cd "$out" && pwd)" |
| 7 | export TMPDIR="$out/tmp" CLANG_MODULE_CACHE_PATH="$out/modules" |
| 8 | swift=(xcrun swiftc -parse-as-library -module-cache-path "$out/modules") |
| 9 | "${swift[@]}" -D GROUNDROOM_SELF_TEST Sources/Groundroom.swift -o "$out/GroundroomChecks" |
| 10 | "$out/GroundroomChecks" |
| 11 | "${swift[@]}" Sources/RoomLayout.swift Checks/LayoutChecks.swift -o "$out/LayoutChecks" |
| 12 | "$out/LayoutChecks" |
| 13 | for entry in 'macosx arm64-apple-macosx14.0 Mac' 'iphoneos arm64-apple-ios17.0 iPhone-iPad' 'xros arm64-apple-xros2.0 VisionPro' 'xrsimulator arm64-apple-xros2.0-simulator VisionSimulator'; do |
| 14 | set -- $entry |
| 15 | sdk=$1 target=$2 name=$3 |
| 16 | "${swift[@]}" -target "$target" -sdk "$(xcrun --sdk "$sdk" --show-sdk-path)" Sources/*.swift -o "$out/$name" |
| 17 | xcrun vtool -show-build "$out/$name" | grep -E 'platform|minos' | tr -s ' ' |
| 18 | done |