generated from thinkode/modelRepository
Closes #34 Implement MIDI peripherals Implement device concept Cleaning project Reviewed-on: #35
55 lines
1.4 KiB
Batchfile
55 lines
1.4 KiB
Batchfile
@echo off
|
||
setlocal
|
||
|
||
echo ============================================
|
||
echo [INFO] Starting Wails build script
|
||
echo ============================================
|
||
|
||
rem Détection du mode (par défaut : build)
|
||
set "MODE=build"
|
||
if /i "%~1"=="-dev" set "MODE=dev"
|
||
|
||
rem 1️⃣ Essayer de récupérer le dernier tag
|
||
for /f "tokens=*" %%i in ('git describe --tags --abbrev=0 2^>nul') do set "GIT_TAG=%%i"
|
||
|
||
rem 2️⃣ Si pas de tag, utiliser le hash du commit
|
||
if "%GIT_TAG%"=="" (
|
||
for /f "tokens=*" %%i in ('git rev-parse --short HEAD 2^>nul') do set "GIT_TAG=%%i"
|
||
)
|
||
|
||
rem 3️⃣ Si Git n’est pas dispo, mettre "unknown"
|
||
if "%GIT_TAG%"=="" set "GIT_TAG=unknown"
|
||
|
||
echo [INFO] Git version detected: %GIT_TAG%
|
||
|
||
|
||
echo [INFO] Mode selectionne : %MODE%
|
||
|
||
echo [INFO] Moving to the C++ folder...
|
||
cd /d "%~dp0hardware\genericftdi\cpp" || (
|
||
echo [ERROR] Impossible d'accéder à hardware\genericftdi\cpp
|
||
exit /b 1
|
||
)
|
||
|
||
echo [INFO] Compiling C++ libraries...
|
||
call generate.bat || (
|
||
echo [ERROR] Échec de la compilation C++
|
||
exit /b 1
|
||
)
|
||
|
||
echo [INFO] Returning to project root...
|
||
cd /d "%~dp0" || exit /b 1
|
||
|
||
if /i "%MODE%"=="dev" (
|
||
echo [INFO] Launching Wails in DEV mode...
|
||
wails dev
|
||
) else (
|
||
echo [INFO] Building Wails application...
|
||
wails build -o "dmxconnect-%GIT_TAG%.exe"
|
||
)
|
||
|
||
echo ============================================
|
||
echo [SUCCESS] Done!
|
||
echo ============================================
|
||
|
||
endlocal |