Download this file
| 1 | #!/bin/sh |
| 2 | # The native gate: the string catalog, BaseKit's tests, the Mac app and an |
| 3 | # unsigned iPhone Simulator build. --release first refuses to go on without |
| 4 | # the pinned Timeless Sans (P8). --core-only (off a Mac) checks the catalog |
| 5 | # alone: everything else needs Xcode. The screenshot gate (snapshots.sh) is |
| 6 | # not run here: its baselines are exact only on the OS that drew them. |
| 7 | set -eu |
| 8 | cd "$(dirname "$0")/.." |
| 9 | release=0 core_only=0 |
| 10 | for argument in "$@"; do |
| 11 | case "$argument" in |
| 12 | --release) release=1 ;; |
| 13 | --core-only) core_only=1 ;; |
| 14 | *) echo "usage: $0 [--release] [--core-only]" >&2; exit 2 ;; |
| 15 | esac |
| 16 | done |
| 17 | python3 scripts/check-strings.py |
| 18 | scripts/worktree-lib_test.sh |
| 19 | [ "$core_only" = 1 ] && exit 0 |
| 20 | if [ "$(uname -s)" != Darwin ]; then |
| 21 | echo "the Apple checks need macOS; use --core-only elsewhere" >&2; exit 2 |
| 22 | fi |
| 23 | if [ "$release" = 1 ]; then scripts/fonts-into-bundle.sh --release; else scripts/fonts-into-bundle.sh; fi |
| 24 | logs=build/logs; mkdir -p "$logs" |
| 25 | swift package --package-path apple resolve |
| 26 | swift test --package-path apple > "$logs/swift-test.log" 2>&1 || { tail -40 "$logs/swift-test.log"; exit 1; } |
| 27 | # XCTest's summary for the whole run, and swift-testing's. |
| 28 | grep -A1 "Test Suite 'All tests' passed" "$logs/swift-test.log" | tail -1 | sed 's/^[[:space:]]*/swift test: /' |
| 29 | swift build --package-path apple --product BaseMac > "$logs/mac-build.log" 2>&1 || { grep -E 'error' "$logs/mac-build.log" | head -20; exit 1; } |
| 30 | echo "BaseMac builds" |
| 31 | scripts/build-iphone.sh simulator > "$logs/phone-build.log" 2>&1 || { grep -E 'error' "$logs/phone-build.log" | head -20; exit 1; } |
| 32 | echo "BasePhone builds for the iOS Simulator" |
| 33 | |