build_mac.sh 1.29 KB
#!/bin/bash
# macOS Build Script for Gemini Image Generator

echo "================================"
echo "Building Gemini Image Generator"
echo "================================"

# Check if virtual environment exists
if [ ! -d ".venv" ]; then
    echo "Creating virtual environment..."
    /opt/homebrew/bin/python3.11 -m venv .venv
fi

# Activate virtual environment
echo "Activating virtual environment..."
source .venv/bin/activate

# Install dependencies
echo "Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt

# Clean previous builds
echo "Cleaning previous builds..."
rm -rf build dist *.spec

# Build executable
echo "Building executable..."
pyinstaller --name="ZB100ImageGenerator" \
    --onedir \
    --windowed \
    --add-data "config.json:." \
    --icon=zb100_mac.icns \
    image_generator.py

# Check if build was successful
if [ -f "dist/ZB100ImageGenerator.app/Contents/MacOS/ZB100ImageGenerator" ] || [ -f "dist/ZB100ImageGenerator" ]; then
    echo "================================"
    echo "Build successful!"
    echo "Application: dist/ZB100ImageGenerator.app (or dist/ZB100ImageGenerator)"
    echo "================================"
else
    echo "================================"
    echo "Build failed!"
    echo "================================"
fi