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