1
1
import subprocess
2
+ from datetime import datetime
2
3
4
+ import FileUtils as file_utils
3
5
import Environment as env
4
6
5
7
game_name = env .get_env_variable ('Game' , 'game_name' )
8
+ builds_dir = env .get_env_variable ( "Game" , "builds_dir" )
6
9
7
10
def build_game ():
8
11
@@ -11,23 +14,27 @@ def build_game():
11
14
print ( '----------------------------------------------------------------------------------------------------' )
12
15
13
16
uproject_file = env .get_env_variable ( "Game" , "uproject_file" )
14
- builds_dir = env .get_env_variable ( "Game" , "builds_dir" )
15
17
build_maps = env .get_env_variable ( "Game" , "build_maps" )
16
18
17
19
ue4_batchfiles_dir = env .get_env_variable ( 'Local' , "ue4_batchfiles_dir" )
18
20
ue4_binaries_dir = env .get_env_variable ( 'Local' , "ue4_binaries_dir" )
19
21
20
22
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" ] ))
21
23
22
- if __name__ == '__main__' :
23
- build_game ()
24
24
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
+
30
33
34
+ if __name__ == '__main__' :
35
+ build_game ()
36
+ zip_build ()
37
+
31
38
# 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%
32
39
# 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%
33
40
# 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():
45
52
# echo. 2>%builds_dir%/BUILD_BROKEN.txt
46
53
# )
47
54
48
-
49
-
50
55
# Adding the steam file to the made build and writing our steam app ID
51
56
# SteamAppID > PathToCreateTextFileAt
52
57
# echo ----------------------------------------------------------------------
0 commit comments