#!/bin/bash
# Clean build artifacts

set -e

echo "🧹 Cleaning build artifacts..."
echo ""

# Clean frontend
if [ -d "node_modules/.cache" ]; then
    echo "Cleaning Vite cache..."
    rm -rf node_modules/.cache
fi

if [ -d ".svelte-kit" ]; then
    echo "Cleaning SvelteKit build..."
    rm -rf .svelte-kit
fi

if [ -d "build" ]; then
    echo "Cleaning build directory..."
    rm -rf build
fi

# Clean Rust
echo "Cleaning Rust target..."
cd src-tauri
cargo clean
cd ..

# Clean Android
if [ -d "src-tauri/gen/android" ]; then
    echo "Cleaning Android build..."
    cd src-tauri/gen/android
    ./gradlew clean 2>/dev/null || true
    cd ../../..
fi

echo ""
echo "✅ Clean complete!"
