Files

45 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Full verification gate. Must be green before a task is marked done (AGENTS.md).
set -euo pipefail
cd "$(dirname "$0")/.."
PKG=Packages/SprachmittlerKit
step() { printf '\n\033[1m▶ %s\033[0m\n' "$*"; }
step "Format check"
if command -v swiftformat >/dev/null; then swiftformat App "$PKG" --lint; else echo "skip: swiftformat not installed"; fi
step "Lint"
if command -v swiftlint >/dev/null; then swiftlint lint --strict --quiet App "$PKG/Sources"; else echo "skip: swiftlint not installed"; fi
step "Shell syntax"
for f in scripts/*.sh; do bash -n "$f"; done
echo "✓ scripts parse"
step "JSON and plist syntax"
for f in opencode.json evaluation/corpus.schema.json evaluation/corpus.example.json; do
jq -e . "$f" >/dev/null
done
plutil -lint App/Info.plist App/Sprachmittler.entitlements >/dev/null
echo "✓ JSON and plists parse"
step "Privacy checks"
scripts/privacy-check.sh
step "Package build"
swift build --package-path "$PKG"
step "Package tests"
swift test --package-path "$PKG" --skip SprachmittlerLiveTests
step "App build"
if command -v xcodegen >/dev/null && command -v xcodebuild >/dev/null; then
xcodegen generate --spec project.yml --quiet
xcodebuild -project Sprachmittler.xcodeproj -scheme Sprachmittler -configuration Debug \
-derivedDataPath .build/xcode -destination 'platform=macOS,arch=arm64' -quiet build
else
echo "skip: xcodegen/xcodebuild not available (make bootstrap)"
fi
printf '\n\033[32m✔ verify passed\033[0m\n'