Skip to content

Commit 89a2808

Browse files
Parse env info from config.ini for BuildGame.py
1 parent eacb6bf commit 89a2808

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

Build_Game.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import Environment
2+
3+
# Build the Game
4+
# *Original from TexMech - C28
5+
6+
# Here it could be useful to echo the build log to a text file so you can see the error if the build fails.
7+
print( '----------------------------------------------------------------------' )
8+
print( 'Step 2: Packaging unreal project into archive ')
9+
print( '----------------------------------------------------------------------' )
10+
11+
section = "BuildGame"
12+
13+
base_dir = Environment.GetEnvVariable( section, "base_dir" )
14+
project_dir = Environment.GetEnvVariable( section, "project_dir" )
15+
uproject_file = Environment.GetEnvVariable( section, "uproject_file" )
16+
builds_dir = Environment.GetEnvVariable( section, "builds_dir" )
17+
build_maps = Environment.GetEnvVariable( section, "build_maps" )
18+
19+
print( base_dir )
20+
print( project_dir )
21+
print( uproject_file )
22+
print( builds_dir )
23+
print( build_maps )
24+
25+
26+
#call "C:\Program Files\Epic Games\UE_4.23\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project=%uproject_file% -noP4 -nocompile -nocompileeditor -installed -cook -stage -archive -archivedirectory=%builds_dir% -package -clientconfig=Development -ue4exe="C:\Program Files\Epic Games\UE_4.23\Engine\Binaries\Win64\UE4Editor-Cmd.exe" -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -CrashReporter -utf8output
27+
# call "C:\Program Files\Epic Games\UE_4.23\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project=%uproject_file% -noP4 -clientconfig=Development -serverconfig=Development -ue4exe=UE4Editor-Cmd.exe -utf8output -installed -platform=Win64 -build -cook -map=%build_maps% -unversionedcookedcontent -pak -SkipCookingEditorContent -compressed -prereqs -stage -package -stagingdirectory=%builds_dir% -archive -archivedirectory=%builds_dir%
28+
# call "C:\Program Files\Epic Games\UE_4.23\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project=%uproject_file% -noP4 -clientconfig=Shipping -serverconfig=Shipping -nocompile -nocompileeditor -installed -ue4exe=UE4Editor-Cmd.exe -utf8output -platform=Win64 -build -cook -map=%build_maps% -unversionedcookedcontent -encryptinifiles -pak -createreleaseversion= -SkipCookingEditorContent -compressed -prereqs -stage -package -stagingdirectory=%builds_dir% -archive -archivedirectory=%builds_dir%
29+
# call "C:\Program Files\Epic Games\UE_4.22\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project=%uproject_file% -noP4 -platform=Win64 -clientconfig=Shipping -serverconfig=Shipping -cook -maps=%build_maps% -build -stage -pak -archive -archivedirectory=%builds_dir%
30+
31+
32+
# Here I do a check to ensure the build was successful
33+
# With these programs, they return 0 on success, so if non-zero return code, just go to fail case below and DON'T make an installer
34+
# Otherwise it will create an installer with the last working build.
35+
# IF %ERRORLEVEL% NEQ 0 (
36+
# echo ----------BUILD FAILED - HALTING BATCH PROCESS----------
37+
# echo PUSHING A TXT FILE TO DELETED NIGHTLY TO SIGNAL BAD BUILD
38+
# net use F: "%network_dir%" gKv52w!* /USER:smu\dummy /PERSISTENT:NO
39+
# echo. 2>%network_dir%/BUILD_BROKEN.txt
40+
# net use F: /d
41+
# echo. 2>%builds_dir%/BUILD_BROKEN.txt
42+
# )
43+
44+
45+
46+
# Adding the steam file to the made build and writing our steam app ID
47+
# SteamAppID > PathToCreateTextFileAt
48+
# echo ----------------------------------------------------------------------
49+
# echo Step 2.5: Adding steam file to build
50+
# echo ----------------------------------------------------------------------
51+
# echo 934840 > C:\AutomatedBuilds\C27\Capstone\ThinkArcade\Build_Dir\WindowsNoEditor\FrostRunner\Binaries\Win64\steam_appid.txt

Environment.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from configparser import ConfigParser
2+
3+
config = ConfigParser()
4+
5+
def ParseEnvVariables():
6+
config.read('config.ini')
7+
8+
def GetEnvVariable( section, var_name ):
9+
if len( config.sections() ) == 0:
10+
ParseEnvVariables()
11+
12+
return config.get(section, var_name)

0 commit comments

Comments
 (0)