Jotley / app · jotley.ai / scripts / check-summary-templates.sh
| 1 | #!/bin/zsh |
| 2 | # Generates a real on-device summary with every template and checks the |
| 3 | # structured rendering. Needs Apple Intelligence on this Mac and a Debug build. |
| 4 | set -euo pipefail |
| 5 | repo_root="$(cd "$(dirname "$0")/.." && pwd)" |
| 6 | products="${JOTLEY_MAC_BUILD_PRODUCTS:-/tmp/jotley-local-xcode-build/Build/Products/Debug}" |
| 7 | work="$(mktemp -d /tmp/jotley-summary-templates.XXXXXX)" |
| 8 | cp "$products/Jotley.app/Contents/MacOS/Jotley.debug.dylib" "$work/" |
| 9 | xcrun swiftc -parse-as-library -target "$(uname -m)-apple-macos27.0" -sdk "$(xcrun --sdk macosx --show-sdk-path)" \ |
| 10 | -I "$products" -F "$products" "$repo_root/scripts/summary-template-check.swift" "$work/Jotley.debug.dylib" \ |
| 11 | -Xlinker -rpath -Xlinker @executable_path -Xlinker -rpath -Xlinker "$products" -o "$work/summary-template-check" |
| 12 | cd "$work" && ./summary-template-check "$@" |
| 13 | echo "Results and renders: $work" |