You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BuildProject.bat
+30-2Lines changed: 30 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,35 @@
1
1
@echooff
2
+
2
3
call"%~dp0ProjectPaths.bat"
3
-
call%~dp0%PROJECT_PATH%\"Plugins/UnrealGDK/SpatialGDK/Build/Scripts/BuildWorker.bat"%GAME_NAME%Server Linux Development %GAME_NAME%.uproject ||goto :error
4
-
call%~dp0%PROJECT_PATH%\"Plugins/UnrealGDK/SpatialGDK/Build/Scripts/BuildWorker.bat"%GAME_NAME% Win64 Development %GAME_NAME%.uproject ||goto :error
4
+
5
+
setlocalEnableDelayedExpansion
6
+
7
+
setGDK_DIRECTORY=""
8
+
9
+
rem If a project plugin exists. Use this for building.
rem If there is no project plugin. Find the engine plugin.
16
+
call"%~dp0FindEngine.bat"
17
+
18
+
if%UNREAL_ENGINE%=="" (
19
+
echo Error: Could not find the Unreal Engine. Please associate your '.uproject' with an engine version or ensure this game project is nested within an engine build.
echo Building worker with GDK located at %GDK_DIRECTORY%
29
+
30
+
call%GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME%Server Linux Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject"||goto :error
31
+
call%GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME%SimulatedPlayer Linux Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject"||goto :error
32
+
call%GDK_DIRECTORY%\SpatialGDK\Build\Scripts\BuildWorker.bat %GAME_NAME% Win64 Development "%~dp0\%PROJECT_PATH%\%GAME_NAME%.uproject"||goto :error
echo Engine association for uproject is: %ENGINE_ASSOCIATION%
24
+
25
+
rem If the engine association is a path then use this. If the path is relative then it will be relative to the uproject, thus we must change directory to the uproject folder.
26
+
27
+
rem Grab the project path from the .uproject file.
28
+
for%%iin (%UPROJECT%) do (
29
+
rem file drive + file directory
30
+
setUNREAL_PROJECT_DIR="%%~di%%~pi"
31
+
)
32
+
33
+
pushd%UNREAL_PROJECT_DIR%
34
+
35
+
ifexist"%ENGINE_ASSOCIATION%" (
36
+
cd /d "%ENGINE_ASSOCIATION%"
37
+
setUNREAL_ENGINE="!cd!"
38
+
)
39
+
40
+
popd
41
+
42
+
rem Try and use the engine association as a key in the registry to get the path to Unreal.
43
+
if%UNREAL_ENGINE%=="" (
44
+
ifnot"%ENGINE_ASSOCIATION%"=="" (
45
+
rem Query the registry for the path to the Unreal Engine using the engine association.
46
+
for /f "usebackq tokens=1,2* skip=2"%%Ain (`reg query"HKCU\Software\Epic Games\Unreal Engine\Builds" /v %ENGINE_ASSOCIATION%`) do (
47
+
setUNREAL_ENGINE="%%C"
48
+
)
49
+
)
50
+
)
51
+
52
+
rem If there was no engine association then we need to climb the directory path of the project to find the Engine.
53
+
if%UNREAL_ENGINE%=="" (
54
+
pushd"%~dp0"
55
+
56
+
:climb_parent_directory
57
+
ifexist Engine (
58
+
rem Check for the Build.version file to be sure we have found a correct Engine folder.
59
+
ifexist"Engine\Build\Build.version" (
60
+
setUNREAL_ENGINE="!cd!"
61
+
)
62
+
) else (
63
+
rem This checks if we are in a root directory. If so we cannot check any higher and so should error out.
64
+
if"%cd:~3,1%"=="" (
65
+
echo Error: Could not find Unreal Engine folder. Please set a project association or ensure your game project is within an Unreal Engine folder.
66
+
pause
67
+
exit /b 1
68
+
)
69
+
cd ..
70
+
goto :climb_parent_directory
71
+
)
72
+
73
+
popd
74
+
)
75
+
76
+
if%UNREAL_ENGINE%=="" (
77
+
echo Error: Could not find the Unreal Engine. Please associate your '.uproject' with an engine version or ensure this game project is nested within an engine build.
0 commit comments