Skip to content

Commit fa88c89

Browse files
committed
ci: Add helper scripts for Windows
1 parent e3415e0 commit fa88c89

File tree

8 files changed

+161
-0
lines changed

8 files changed

+161
-0
lines changed

Scripts/build.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Building...
7+
echo.
8+
9+
cd ..\..\..
10+
11+
%RunUAT% BuildCookRun -project=%ProjectPath% -map=%UnitTestMap% -build -unattended -nullrhi -ExecCmds="Automation Quit"
12+

Scripts/buildCookTest.bat

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
@echo off
3+
4+
build.bat && buildMaps.bat && cook.bat && test.bat

Scripts/buildMaps.bat

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Building maps...
7+
echo.
8+
9+
cd ..\..\..
10+
11+
%UEEditorCmd% %ProjectPath% %UnitTestMap% -run=resavepackages -buildhlod -buildlighting -quality=production -allowcommandletrendering -unattended -map=%AllMaps%

Scripts/client.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Running client and connecting to %LocalIP% ...
7+
echo.
8+
9+
cd ..\..\..
10+
11+
%UEEditor% %ProjectPath% %LocalIP% -game -log
12+

Scripts/cook.bat

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Running dedicated server...
7+
echo.
8+
9+
cd ..\..\..
10+
11+
%RunUAT% BuildCookRun -project=%ProjectPath% -map=%UnitTestMap% -nop4 -build -cook -cookall -unattended

Scripts/env.bat

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
@echo off
3+
4+
if "%UEBatchScriptEnvLoaded%"=="true" (
5+
exit /B 0
6+
)
7+
set UEBatchScriptEnvLoaded=true
8+
9+
set PluginScriptDir=%~dp0
10+
cd ..\..\..
11+
12+
for /F "tokens=4 delims= " %%i in ('route print ^| find " 0.0.0.0"') do set LocalIP=%%i
13+
14+
for %%f in (*.uproject) do (
15+
set ProjectPath="%cd%\%%f"
16+
for /F "eol=, tokens=1,2*" %%i in (%%f) do (
17+
if %%i==^"EngineAssociation^"^: (
18+
if %%j==^"4.27^"^, (
19+
set UEVersion=4.27
20+
set UEEnginePath=%UE427EnginePath%
21+
)
22+
if %%j==^"5.0^"^, (
23+
set UEVersion=5.0
24+
set UEEnginePath=%UE50EnginePath%
25+
)
26+
if %%j==^"5.1^"^, (
27+
set UEVersion=5.1
28+
set UEEnginePath=%UE51EnginePath%
29+
)
30+
if %%j==^"5.2^"^, (
31+
set UEVersion=5.2
32+
set UEEnginePath=%UE52EnginePath%
33+
)
34+
if %%j==^"5.3^"^, (
35+
set UEVersion=5.3
36+
set UEEnginePath=%UE53EnginePath%
37+
)
38+
if %%j==^"5.4^"^, (
39+
set UEVersion=5.4
40+
set UEEnginePath=%UE54EnginePath%
41+
)
42+
if %%j==^"5.5^"^, (
43+
set UEVersion=5.5
44+
set UEEnginePath=%UE55EnginePath%
45+
)
46+
)
47+
)
48+
)
49+
50+
if "%UEEnginePath%"=="" (
51+
echo ERROR: Could not find Unreal Engine v%UEVersion% for project %ProjectPath%, please add your Unreal engine paths to your system environment variables in the format UE52EnginePath=C:\path\to\Unreal_5.2\Engine .
52+
exit 0
53+
)
54+
55+
set RunUAT="%UEEnginePath%\Build\BatchFiles\RunUAT.bat"
56+
57+
if %UEVersion%==4.27 (
58+
set UEEditor="%UEEnginePath%\Binaries\Win64\UE4Editor.exe"
59+
set UEEditorCmd="%UEEnginePath%\Binaries\Win64\UE4Editor-Cmd.exe"
60+
) else (
61+
set UEEditor="%UEEnginePath%\Binaries\Win64\UnrealEditor.exe"
62+
set UEEditorCmd="%UEEnginePath%\Binaries\Win64\UnrealEditor-Cmd.exe"
63+
)
64+
65+
:: TODO: set these up for the plugin
66+
set UnitTestMap=/Game/Maps/AutomatedTestMap
67+
set MainMenuMap=/Game/Maps/MainMenuMap
68+
set MainGameMap=/Game/Maps/PlayMap
69+
set AllMaps=%UnitTestMap%+%MainMenuMap%+%MainGameMap%
70+
71+
echo Running on %COMPUTERNAME%
72+
echo UEVersion: %UEVersion%
73+
echo UEEnginePath: %UEEnginePath%
74+
echo UEEditor: %UEEditor%
75+
echo RunUAT: %RunUAT%
76+
echo ProjectPath: %ProjectPath%
77+
echo.
78+
79+
cd %PluginScriptDir%

Scripts/server.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Running dedicated server...
7+
echo.
8+
9+
cd ..\..\..
10+
11+
%UEEditor% %ProjectPath% %MainGameMap% -server -log=DedicatedServer.log
12+

Scripts/test.bat

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
@echo off
3+
4+
call env.bat
5+
6+
echo Running plugin tests...
7+
echo.
8+
9+
set TestScope=Immutable
10+
11+
cd ..\..\..
12+
13+
%UEEditor% ^
14+
%ProjectPath% %UnitTestMap% ^
15+
-AutomatedMapBuild=%UnitTestMap% ^
16+
-buildmachine -NullRHI -unattended -NoSound -NoP4 -nosplash -nopause ^
17+
-ExecCmds="Automation RunTests %TestScope%; Quit" ^
18+
-TestExit="Automation Test Queue Empty" ^
19+
-log=Test.log
20+

0 commit comments

Comments
 (0)