| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- @echo off
- setlocal
- echo === BLE Relay Build Script ===
- echo.
- REM Check Python
- where python >nul 2>nul
- if %errorlevel% neq 0 (
- echo ERROR: Python not found. Please install Python 3 and add to PATH.
- exit /b 1
- )
- REM Install dependencies
- echo Installing dependencies...
- python -m pip install pyinstaller bleak
- if %errorlevel% neq 0 (
- echo ERROR: Failed to install dependencies.
- exit /b 1
- )
- REM Create output dir
- if not exist bin mkdir bin
- REM Build
- echo.
- echo Building ble_relay.exe...
- python -m PyInstaller --onefile --name ble_relay --distpath bin --specpath build --workpath build scripts\ble_relay.py
- if %errorlevel% neq 0 (
- echo ERROR: PyInstaller build failed.
- exit /b 1
- )
- REM Copy to cmd/monitor for go:embed
- echo.
- echo Copying to cmd/monitor/ for embedding...
- copy /Y bin\ble_relay.exe cmd\monitor\ble_relay.exe >nul
- if %errorlevel% neq 0 (
- echo ERROR: Failed to copy ble_relay.exe
- exit /b 1
- )
- echo.
- echo === Build complete ===
- echo bin\ble_relay.exe
- echo cmd\monitor\ble_relay.exe
- echo.
- echo Now run: go build -tags ble -o bin\opencode-monitor.exe .\cmd\monitor
- endlocal
|