#!/bin/bash # Verify Aligner still builds and tests with macOS 14.0 as the deployment target. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" OUTPUT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" SOURCE_ROOT="$OUTPUT_ROOT/C1.source" REPORT_ROOT="$OUTPUT_ROOT/C2.builds/Z-研发中间产物/qa-reports" REPORT="$REPORT_ROOT/round015-macos14-compatibility-qa.json" TMP_ROOT="" cleanup() { if [ -n "$TMP_ROOT" ]; then rm -rf "$TMP_ROOT" fi } trap cleanup EXIT fail() { local message="$1" mkdir -p "$REPORT_ROOT" cat > "$REPORT" <&2 exit 1 } run_step() { local name="$1" shift echo "==> $name" "$@" } TMP_ROOT="$(mktemp -d /tmp/aligner-macos14-compatibility.XXXXXX)" rsync -a --exclude .build --exclude .swiftpm "$SOURCE_ROOT/" "$TMP_ROOT/C1.source/" run_step "swift-build-macos14" swift build --package-path "$TMP_ROOT/C1.source" run_step "swift-test-macos14" swift test --package-path "$TMP_ROOT/C1.source" PACKAGE_MINIMUM="$(/usr/bin/grep -F '.macOS("14.0")' "$SOURCE_ROOT/Package.swift" || true)" PLIST_MINIMUM="$(/usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' "$SOURCE_ROOT/Resources/Aligner-Info.plist" 2>/dev/null || true)" APP_INFO_MINIMUM="$(/usr/bin/grep -F 'minimumMacOSVersion = "14.0"' "$SOURCE_ROOT/Sources/AlignerCore/AppInfo.swift" || true)" PUBLIC_TEMPLATE_MINIMUM="$(/usr/bin/grep -F '"minimumMacOS": "14.0"' "$OUTPUT_ROOT/C3.tools/public-latest-manifest-template.json" || true)" if [ -z "$PACKAGE_MINIMUM" ]; then fail "Package.swift does not declare macOS 14.0" fi if [ "$PLIST_MINIMUM" != "14.0" ]; then fail "Info.plist LSMinimumSystemVersion is $PLIST_MINIMUM, expected 14.0" fi if [ -z "$APP_INFO_MINIMUM" ]; then fail "AlignerAppInfo.minimumMacOSVersion is not 14.0" fi if [ -z "$PUBLIC_TEMPLATE_MINIMUM" ]; then fail "public latest manifest template minimumMacOS is not 14.0" fi mkdir -p "$REPORT_ROOT" cat > "$REPORT" <