Branchwell

PulseCanvas / app · pulsecanvas.ai / scripts / native-gallery.sh

Raw 1.4 KB on 0e4fe45e403a1b6b5a57aa68addd681995d37722
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
7set -euo pipefail
8cd "$(dirname "$0")/.."
9mkdir -p .build/validation
10binary=.build/validation/native-gallery
11sources=(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)
15needs_build=0
16[ -x "$binary" ] || needs_build=1
17for source in "${sources[@]}"; do [ "$source" -nt "$binary" ] && needs_build=1; done
18if [ "$needs_build" = 1 ]; then
19 xcrun swiftc -O -suppress-warnings -swift-version 6 -D STORE_BUILD -parse-as-library "${sources[@]}" -o "$binary"
20fi
21"$binary" "$@"