Skip to content

Commit 05c8ab6

Browse files
NightlyBuildsNightlyBuilds
authored andcommitted
Merge branch 'master' of github.com:JRProd/TGP2BuildScripts
2 parents f7b4b0d + 9446e53 commit 05c8ab6

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

BuildGame.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import subprocess
2+
from datetime import datetime
23

4+
import FileUtils as file_utils
35
import Environment as env
46

57
game_name = env.get_env_variable('Game', 'game_name')
8+
builds_dir = env.get_env_variable( "Game", "builds_dir" )
69

710
def build_game():
811

@@ -11,23 +14,27 @@ def build_game():
1114
print( '----------------------------------------------------------------------------------------------------' )
1215

1316
uproject_file = env.get_env_variable( "Game", "uproject_file" )
14-
builds_dir = env.get_env_variable( "Game", "builds_dir" )
1517
build_maps = env.get_env_variable( "Game", "build_maps" )
1618

1719
ue4_batchfiles_dir = env.get_env_variable( 'Local', "ue4_batchfiles_dir" )
1820
ue4_binaries_dir = env.get_env_variable( 'Local', "ue4_binaries_dir" )
1921

2022
print(subprocess.run( [ ue4_batchfiles_dir + 'RunUAT.bat', "BuildCookRun", "-project=" + uproject_file, "-noP4", "-nocompile", "-nocompileeditor", "-installed", "-cook", "-stage", "-archive", "-archivedirectory=" + builds_dir, "-package", "-clientconfig=Development", "-ue4exe=" + ue4_binaries_dir + "UE4Editor-Cmd.exe", "-pak", "-prereqs", "-nodebuginfo", "-targetplatform=Win64", "-build", "-CrashReporter", "-utf8output" ] ))
2123

22-
if __name__ == '__main__':
23-
build_game()
2424

25-
#subprocess.call([r"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
26-
# subprocess.call("%unreal_batchfiles_dir%'RunUAT.bat', BuildCookRun -project=%uproject_file% -noP4 -nocompile -nocompileeditor -installed -cook -stage -archive -archivedirectory=%builds_dir% -package -clientconfig=Development -ue4exe=%ue4_binaries_dir%'UE4Editor-Cmd.exe' -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -CrashReporter -utf8output" )
27-
# p = Popen([ ], stdout=PIPE, stderr=PIPE)
28-
# output, errors = p.communicate()
29-
# p.wait() # wait for process to terminate
25+
def zip_build():
26+
latest_build_dir = env.get_env_variable( "Game", "latest_build_dir" )
27+
28+
now = datetime.now()
29+
now_str = now.strftime( "%m_%d_%H_%M" )
30+
31+
file_utils.zip_file_directory( latest_build_dir, builds_dir + "HaberDashers_" + now_str + ".zip" )
32+
3033

34+
if __name__ == '__main__':
35+
build_game()
36+
zip_build()
37+
3138
# 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%
3239
# 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%
3340
# 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%
@@ -45,8 +52,6 @@ def build_game():
4552
# echo. 2>%builds_dir%/BUILD_BROKEN.txt
4653
# )
4754

48-
49-
5055
# Adding the steam file to the made build and writing our steam app ID
5156
# SteamAppID > PathToCreateTextFileAt
5257
# echo ----------------------------------------------------------------------

FileUtils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
import zipfile
3+
4+
def zip_file_directory( directory_path, zip_file_path ):
5+
zip_file = zipfile.ZipFile( zip_file_path, 'w', zipfile.ZIP_STORED )
6+
7+
prefix_path = directory_path.split( 'WindowsNoEditor/' )
8+
9+
for root, dirs, files in os.walk( directory_path ):
10+
for file in files:
11+
relative_path = os.path.relpath( root, prefix_path[0] )
12+
13+
zip_file.write( os.path.join( root, file ), relative_path + '\\' + file )
14+
15+
zip_file.close()
16+

0 commit comments

Comments
 (0)