Files
CBE/build-windows.bat
T
2026-06-04 03:22:17 +00:00

71 lines
1.7 KiB
Batchfile

@echo off
REM ===========================================================
REM CBE Emulator - Windows build script
REM Run this on Windows with JDK 14+ installed.
REM Produces: build\installer\CBE-Emulator.exe (or .msi)
REM ===========================================================
setlocal
cd /d "%~dp0"
echo.
echo === CBE Emulator - Windows build ===
echo.
REM 1. Build the project
echo [1/4] Building Gradle project...
call gradlew.bat :modules:gui:stage --no-daemon
if errorlevel 1 goto :err
REM 2. Detect Java
where jpackage >nul 2>nul
if errorlevel 1 (
echo jpackage not found in PATH. Please install JDK 14+.
exit /b 1
)
REM 3. Choose installer type (default: exe)
set PKG_TYPE=exe
if not "%~1"=="" set PKG_TYPE=%~1
REM 4. Run jpackage
echo.
echo [2/4] Packaging with jpackage (type=%PKG_TYPE%)...
if exist build\installer rmdir /s /q build\installer
jpackage ^
--input modules\gui\build\stage ^
--dest build\installer ^
--name CBE-Emulator ^
--main-jar cbe-emu.jar ^
--main-class com.cbe.gui.Main ^
--app-version 0.1.0 ^
--vendor "CBE Project" ^
--description "CBE Platform - Emulator" ^
--type %PKG_TYPE% ^
--java-options "-Xmx256m"
if errorlevel 1 goto :err
echo.
echo [3/4] Done!
echo Output: build\installer\
dir /b build\installer
REM 4. Stage plugins next to the .exe for convenience
echo.
echo [4/4] Copying example plugins next to launcher...
if not exist build\plugins mkdir build\plugins
copy examples\tiny-cpu.cpu\roms\boot.bin build\plugins\ >nul
copy examples\basic-ram.ram\*.* build\plugins\ >nul
copy examples\vga-display.gpu\*.* build\plugins\ >nul
echo.
echo Build complete. Find your installer at:
echo build\installer\
echo.
exit /b 0
:err
echo.
echo BUILD FAILED.
exit /b 1