PulseCanvas / app · pulsecanvas.ai / scripts / native-gallery.sh
| 1 | #!/bin/bash |
| 2 | # Build and run the native effect gallery. Examples: |
| 3 | # scripts/native-gallery.sh stills --scenes 31-99 --size 640x360 --out .build/gallery/wide |
| 4 | # scripts/native-gallery.sh frames --scenes 40 --size 480x270 --start 10 --duration 4 --fps 30 |
| 5 | # scripts/native-gallery.sh audit --scenes 0-99 --size 320x180 --duration 2 --fps 60 |
| 6 | # scripts/native-gallery.sh timing --scenes 31-99 --size 3840x2160 |
| 7 | set -euo pipefail |
| 8 | cd "$(dirname "$0")/.." |
| 9 | mkdir -p .build/validation |
| 10 | binary=.build/validation/native-gallery |
| 11 | sources=(Sources/PulseCanvas/SecurityScopedAccess.swift Sources/PulseCanvas/VisualPalette.swift Sources/PulseCanvas/*Geometry.swift |
| 12 | Sources/PulseCanvas/StrobeDetector.swift Sources/PulseCanvas/VisualPreset.swift Sources/PulseCanvas/ProjectMPresets.swift Sources/PulseCanvas/VisualizerRenderer.swift |
| 13 | Sources/PulseCanvas/NativeEffects.swift Sources/PulseCanvas/AudioAnalysis.swift Sources/PulseCanvas/SocialExportController.swift |
| 14 | Sources/PulseCanvas/StudioTimeline.swift Sources/PulseCanvas/StudioStore.swift scripts/RendererBundle.swift scripts/NativeGallery.swift) |
| 15 | needs_build=0 |
| 16 | [ -x "$binary" ] || needs_build=1 |
| 17 | for source in "${sources[@]}"; do [ "$source" -nt "$binary" ] && needs_build=1; done |
| 18 | if [ "$needs_build" = 1 ]; then |
| 19 | xcrun swiftc -O -suppress-warnings -swift-version 6 -D STORE_BUILD -parse-as-library "${sources[@]}" -o "$binary" |
| 20 | fi |
| 21 | "$binary" "$@" |