#!/bin/bash # ============================================================================ # Flutter Build Environment Checker # ============================================================================ echo "========================================" echo " FLUTTER BUILD CHECKER" echo "========================================" echo "" # Check Flutter installation if ! command -v flutter &> /dev/null; then echo "[ERROR] Flutter is NOT installed!" echo "" echo "To install Flutter:" echo " Linux: https://docs.flutter.dev/get-started/install/linux" echo " Windows: https://docs.flutter.dev/get-started/install/windows" echo " macOS: https://docs.flutter.dev/get-started/install/macos" exit 1 fi echo "[✓] Flutter is installed" echo "" # Show Flutter version echo "Flutter version:" flutter --version echo "" # Check Flutter doctor echo "Flutter doctor status:" flutter doctor echo "" # Check if we can build for current platform OS="$(uname -s)" case "$OS" in Linux*) echo "Checking Linux build capability..." flutter build linux --help > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[✓] Linux build is supported" echo "" echo "To build the Windows client:" echo " ./BUILD_CLIENT_LINUX.sh" else echo "[!] Linux build is NOT available" echo "Install dependencies:" echo " sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev" fi ;; Darwin*) echo "Checking macOS build capability..." flutter build macos --help > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[✓] macOS build is supported" else echo "[!] macOS build is NOT available (install Xcode)" fi ;; MINGW*|MSYS*|CYGWIN*) echo "Windows detected via Git Bash/MSYS" flutter build windows --help > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[✓] Windows build is supported" echo "" echo "To build the Windows client:" echo " BUILD_CLIENT_WINDOWS.bat" else echo "[!] Windows build is NOT available (install Visual Studio)" fi ;; *) echo "Unknown OS: $OS" ;; esac echo "" echo "========================================" echo " CHECK COMPLETE" echo "========================================"