#!/bin/bash
set -e

# Momentry Build Script

cd /Users/accusys/momentry_core_0.1

echo "========================================"
echo "Building Momentry"
echo "========================================"

# Check if cargo is available
if ! command -v cargo > /dev/null 2>&1; then
    echo "ERROR: Rust/Cargo not found. Please install Rust first."
    echo "Visit: https://rustup.rs"
    exit 1
fi

# Build in release mode
echo "Building release version..."
cargo build --release

# Also build video_player
cd /Users/accusys/video_player
echo "Building video_player..."
cargo build --release

echo "========================================"
echo "Build Complete!"
echo "========================================"
echo "Momentry binary: /Users/accusys/momentry_core_0.1/target/release/momentry"
echo "Video player:   /Users/accusys/video_player/target/release/video_player"
