build.bat 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. REM Exit immediately if a command exits with a non-zero status
  4. set "RED=^[[31m"
  5. set "GREEN=^[[32m"
  6. set "YELLOW=^[[33m"
  7. set "BLUE=^[[34m"
  8. set "RESET=^[[0m"
  9. REM Check and update git submodules
  10. echo !BLUE![INFO] Checking for git submodules...!RESET!
  11. git submodule update --init --recursive
  12. REM Change directory to hpff and build
  13. echo !GREEN![BUILD] Building hpff...!RESET!
  14. REM Check for the --release flag
  15. set "BUILD_CMD=dub build --force"
  16. if "%~1"=="--release" (
  17. set "BUILD_CMD=dub build --build=release --force"
  18. )
  19. REM Execute the build command and hide output, but capture errors
  20. echo !GREEN![BUILD] Building engine...!RESET!
  21. echo !BLUE![INFO] If no Build complete shown, then engine not built, check log.txt for details.!RESET!
  22. if exist "log.txt" (
  23. echo !YELLOW![WARNING] log file already exists, continue build...!RESET!
  24. %BUILD_CMD% > log.txt 2>&1
  25. ) else (
  26. echo !YELLOW![WARNING] log file does not exist, creating and continue build...!RESET!
  27. echo. > log.txt
  28. %BUILD_CMD% > log.txt 2>&1
  29. )
  30. REM If the build was successful, proceed with further steps
  31. REM strip ./libplayback.so
  32. strip libhpff.so
  33. strip heaven-engine
  34. echo MADE_BY_QUANTUMDE1_UNDERLEVEL_STUDIOS_2024_ALL_RIGHTS_RESERVED_UNDER_MIT_LICENSE_LMAO >> heaven-engine
  35. echo #!/bin/sh > sky.bat
  36. echo exec heaven-engine >> sky.bat
  37. echo !GREEN![BUILD] Build complete.!RESET!
  38. echo !GREEN![INFO] All processes completed successfully.!RESET!
  39. endlocal