oficina / base Public

Clone
git clone https://amadan.net/oficina/base

Plain git — no account needed to clone.

Download

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.
7set -eu
8cd "$(dirname "$0")/.."
9release=0 core_only=0
10for 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
16done
17python3 scripts/check-strings.py
18scripts/worktree-lib_test.sh
19[ "$core_only" = 1 ] && exit 0
20if [ "$(uname -s)" != Darwin ]; then
21 echo "the Apple checks need macOS; use --core-only elsewhere" >&2; exit 2
22fi
23if [ "$release" = 1 ]; then scripts/fonts-into-bundle.sh --release; else scripts/fonts-into-bundle.sh; fi
24logs=build/logs; mkdir -p "$logs"
25swift package --package-path apple resolve
26swift 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.
28grep -A1 "Test Suite 'All tests' passed" "$logs/swift-test.log" | tail -1 | sed 's/^[[:space:]]*/swift test: /'
29swift build --package-path apple --product BaseMac > "$logs/mac-build.log" 2>&1 || { grep -E 'error' "$logs/mac-build.log" | head -20; exit 1; }
30echo "BaseMac builds"
31scripts/build-iphone.sh simulator > "$logs/phone-build.log" 2>&1 || { grep -E 'error' "$logs/phone-build.log" | head -20; exit 1; }
32echo "BasePhone builds for the iOS Simulator"
33