Files
Sprachmittler/scripts/verify.sh
T
schihei 7ca5c710ec feat(m0): complete scaffold, logging and signature checks (T0.2-T0.6)
Add os.Logger categories, OSSignposter wrapper and shortHash helper; enforce exact Debug/Release/install signatures; lint tests; update M0 docs and progress.
2026-11-26 12:33:51 +01:00

55 lines
2.0 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" "$PKG/Tests"; 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
scripts/check-signature.sh .build/xcode/Build/Products/Debug/Sprachmittler.app debug
else
echo "skip: xcodegen/xcodebuild not available (make bootstrap)"
fi
step "Release build and signature"
if command -v xcodegen >/dev/null && command -v xcodebuild >/dev/null; then
xcodebuild -project Sprachmittler.xcodeproj -scheme Sprachmittler -configuration Release \
-derivedDataPath .build/xcode-release -destination 'platform=macOS,arch=arm64' -quiet build
scripts/check-signature.sh .build/xcode-release/Build/Products/Release/Sprachmittler.app release
else
echo "skip: xcodegen/xcodebuild not available (make bootstrap)"
fi
printf '\n\033[32m✔ verify passed\033[0m\n'