More refactors, remove universal camera, tweak build script
This commit is contained in:
167
BuildGame.bat
167
BuildGame.bat
@@ -1,18 +1,26 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
echo ===================================
|
||||
echo Eleri - Build, Upload and Notify
|
||||
echo ===================================
|
||||
|
||||
:: ---- CONFIG — edit these ----
|
||||
:: ---- CONFIG - edit these ----
|
||||
set UE_VERSION=5.8
|
||||
set PROJECT_PATH=C:\Projects\ProjectEleri\ProjectEleri.uproject
|
||||
set PROJECT_NAME=Eleri
|
||||
set OUTPUT_DIR=C:\Projects\ProjectEleri\BUILD\Debug
|
||||
set OUTPUT_DIR=C:\Projects\ProjectEleri\BUILD
|
||||
set MAX_BUILDS=10
|
||||
set UAT_PATH=C:\Program Files\Epic Games\UE_%UE_VERSION%\Engine\Build\BatchFiles\RunUAT.bat
|
||||
|
||||
:: ---- STEAM CONFIG - edit these ----
|
||||
set STEAMCMD_PATH=C:\Users\adnan\Downloads\steamworks_sdk_161\sdk\tools\ContentBuilder\builder\steamcmd.exe
|
||||
set STEAM_USERNAME=adodev
|
||||
set STEAM_APP_ID=3528720
|
||||
:: Only Shipping gets uploaded to Steam - DebugGame builds are local-only
|
||||
set STEAM_DEPOT_SHIPPING=3528721
|
||||
:: Folder where generated Steam VDF scripts will be written (temp working files, safe to keep in OUTPUT_DIR)
|
||||
set STEAM_VDF_DIR=%OUTPUT_DIR%\steam_vdf
|
||||
|
||||
:: ---- ARGUMENTS ----
|
||||
set BUILD_VERSION=%1
|
||||
set CHANGELOG=%~2
|
||||
@@ -25,33 +33,68 @@ if "%CHANGELOG%"=="" set /p CHANGELOG="Changelog / notes (optional, press Enter
|
||||
echo.
|
||||
echo Which steps would you like to run?
|
||||
echo 1 - Build only
|
||||
echo 2 - Build + Zip
|
||||
echo 2 - Build + Upload to Steam
|
||||
echo.
|
||||
set /p RUN_STEPS="Enter choice (1-2): "
|
||||
if "%RUN_STEPS%"=="" set RUN_STEPS=1
|
||||
if "%RUN_STEPS%" LSS "1" set RUN_STEPS=1
|
||||
if "%RUN_STEPS%" GTR "2" set RUN_STEPS=1
|
||||
|
||||
if "%RUN_STEPS%"=="" set RUN_STEPS=2
|
||||
if "%RUN_STEPS%" LSS "1" set RUN_STEPS=2
|
||||
if "%RUN_STEPS%" GTR "4" set RUN_STEPS=2
|
||||
:: ---- CONFIG SELECTION ----
|
||||
echo.
|
||||
echo Which configuration(s) would you like to build?
|
||||
echo 1 - DebugGame
|
||||
echo 2 - Shipping
|
||||
echo 3 - Both
|
||||
echo.
|
||||
set /p CFG_CHOICE="Enter choice (1-3): "
|
||||
if "%CFG_CHOICE%"=="" set CFG_CHOICE=1
|
||||
if "%CFG_CHOICE%"=="1" set CONFIGS=DebugGame
|
||||
if "%CFG_CHOICE%"=="2" set CONFIGS=Shipping
|
||||
if "%CFG_CHOICE%"=="3" set CONFIGS=DebugGame Shipping
|
||||
if not defined CONFIGS set CONFIGS=DebugGame
|
||||
|
||||
echo.
|
||||
echo Running steps 1 through %RUN_STEPS%...
|
||||
|
||||
set BUILD_TYPE=debug
|
||||
set DEST_FILENAME=%PROJECT_NAME%_%BUILD_VERSION%.zip
|
||||
set BUILD_OUTPUT=%OUTPUT_DIR%\%BUILD_VERSION%%
|
||||
echo Running steps 1 through %RUN_STEPS% for configuration(s): %CONFIGS%
|
||||
echo.
|
||||
|
||||
:: ====================================
|
||||
:: STEP 1 — BUILD
|
||||
:: MAIN LOOP - one pass per selected config
|
||||
:: ====================================
|
||||
echo.
|
||||
echo [1/2] Building %PROJECT_NAME% in DebugGame mode...
|
||||
echo.
|
||||
for %%C in (%CONFIGS%) do (
|
||||
call :build_one_config %%C
|
||||
if !errorlevel! neq 0 (
|
||||
echo ERROR: Pipeline failed for config %%C.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ===================================
|
||||
echo All done! (ran steps 1-%RUN_STEPS% for: %CONFIGS%)
|
||||
echo ===================================
|
||||
pause
|
||||
exit /b 0
|
||||
|
||||
|
||||
:: ====================================
|
||||
:: SUBROUTINE - build/upload a single config
|
||||
:: %1 = config name (DebugGame or Shipping)
|
||||
:: ====================================
|
||||
:build_one_config
|
||||
set THIS_CONFIG=%~1
|
||||
set BUILD_OUTPUT=%OUTPUT_DIR%\%BUILD_VERSION%\%THIS_CONFIG%
|
||||
|
||||
:: ---- STEP 1: BUILD ----
|
||||
echo.
|
||||
echo [1/2] Building %PROJECT_NAME% in %THIS_CONFIG% mode...
|
||||
echo.
|
||||
call "%UAT_PATH%" BuildCookRun ^
|
||||
-project="%PROJECT_PATH%" ^
|
||||
-noP4 ^
|
||||
-platform=Win64 ^
|
||||
-clientconfig=DebugGame ^
|
||||
-clientconfig=%THIS_CONFIG% ^
|
||||
-cook ^
|
||||
-build ^
|
||||
-stage ^
|
||||
@@ -60,45 +103,75 @@ call "%UAT_PATH%" BuildCookRun ^
|
||||
-archivedirectory="%BUILD_OUTPUT%" ^
|
||||
-prereqs ^
|
||||
-nodebuginfo
|
||||
|
||||
set BUILD_EXIT=%errorlevel%
|
||||
echo.
|
||||
echo UAT exited with code: %BUILD_EXIT%
|
||||
|
||||
if %BUILD_EXIT% neq 0 (
|
||||
echo ERROR: Build failed!
|
||||
pause
|
||||
echo ERROR: Build failed for %THIS_CONFIG%!
|
||||
exit /b 1
|
||||
)
|
||||
echo Build succeeded for %THIS_CONFIG%!
|
||||
echo Build folder: %BUILD_OUTPUT%
|
||||
|
||||
if %RUN_STEPS% EQU 1 exit /b 0
|
||||
|
||||
:: ---- STEP 2: UPLOAD TO STEAM ----
|
||||
if /I "%THIS_CONFIG%"=="DebugGame" (
|
||||
echo.
|
||||
echo DebugGame is local-only - skipping Steam upload for this config.
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
echo.
|
||||
echo [2/2] Uploading %THIS_CONFIG% build to Steam...
|
||||
|
||||
set STEAM_DEPOT=%STEAM_DEPOT_SHIPPING%
|
||||
|
||||
if "%STEAM_DEPOT%"=="" (
|
||||
echo ERROR: No Steam depot ID configured for Shipping. Skipping upload.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Build succeeded!
|
||||
if %RUN_STEPS% EQU 1 goto :done
|
||||
if not exist "%STEAM_VDF_DIR%" mkdir "%STEAM_VDF_DIR%"
|
||||
set APP_VDF=%STEAM_VDF_DIR%\app_build_%THIS_CONFIG%.vdf
|
||||
set DEPOT_VDF=%STEAM_VDF_DIR%\depot_build_%THIS_CONFIG%.vdf
|
||||
|
||||
:: ====================================
|
||||
:: STEP 2 — ZIP
|
||||
:: ====================================
|
||||
echo.
|
||||
echo [2/2] Zipping build...
|
||||
:: Generate depot script - points at the build output directly
|
||||
(
|
||||
echo "DepotBuildConfig"
|
||||
echo {
|
||||
echo "DepotID" "%STEAM_DEPOT%"
|
||||
echo "ContentRoot" "%BUILD_OUTPUT%"
|
||||
echo "FileMapping"
|
||||
echo {
|
||||
echo "LocalPath" "*"
|
||||
echo "DepotPath" "."
|
||||
echo "recursive" "1"
|
||||
echo }
|
||||
echo }
|
||||
) > "%DEPOT_VDF%"
|
||||
|
||||
set ZIP_PATH=%OUTPUT_DIR%\%DEST_FILENAME%
|
||||
:: Generate app build script
|
||||
(
|
||||
echo "AppBuild"
|
||||
echo {
|
||||
echo "AppID" "%STEAM_APP_ID%"
|
||||
echo "Desc" "%PROJECT_NAME% %BUILD_VERSION% [%THIS_CONFIG%] - %CHANGELOG%"
|
||||
echo "ContentRoot" "%BUILD_OUTPUT%"
|
||||
echo "BuildOutput" "%STEAM_VDF_DIR%\output_%THIS_CONFIG%"
|
||||
echo "Depots"
|
||||
echo {
|
||||
echo "%STEAM_DEPOT%" "%DEPOT_VDF%"
|
||||
echo }
|
||||
echo }
|
||||
) > "%APP_VDF%"
|
||||
|
||||
powershell -Command "Compress-Archive -Path '%BUILD_OUTPUT%\*' -DestinationPath '%ZIP_PATH%' -Force"
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
echo ERROR: Zipping failed.
|
||||
pause & exit /b 1
|
||||
"%STEAMCMD_PATH%" +login %STEAM_USERNAME% +run_app_build "%APP_VDF%" +quit
|
||||
set STEAM_EXIT=%errorlevel%
|
||||
if %STEAM_EXIT% neq 0 (
|
||||
echo ERROR: Steam upload failed for %THIS_CONFIG% ^(exit code %STEAM_EXIT%^).
|
||||
exit /b 1
|
||||
)
|
||||
echo Steam upload succeeded for %THIS_CONFIG%!
|
||||
|
||||
echo Zip created: %ZIP_PATH%
|
||||
echo Build folder kept at: %BUILD_OUTPUT%
|
||||
if %RUN_STEPS% EQU 2 goto :done
|
||||
|
||||
:: ====================================
|
||||
:done
|
||||
:: ====================================
|
||||
echo.
|
||||
echo ===================================
|
||||
echo All done! (ran steps 1-%RUN_STEPS%)
|
||||
echo Build: %DEST_FILENAME%
|
||||
echo ===================================
|
||||
pause
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user