55import shutil
66import zipfile
77
8- UE_VERSIONS = ['4.15' , '4.16' , '4.17' , '4.18' , '4.19' , '4.20' ]
9- PYTHON_VERSIONS = ["C:/Program Files/Python36" , "C:/Program Files/Python37" , "C:/Python27" ]
8+ UE_VERSIONS = ['4.15' , '4.16' , '4.17' , '4.18' , '4.19' , '4.20' , '4.21' ]
9+ PYTHON_VERSIONS = ["C:/Program Files/Python37" , "C:/Program Files/Python36" , "C:/Python27" ]
10+ MSBUILD = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe'
11+ UE_PATH = 'C:/Program Files/Epic Games'
12+ PROJECTS_PATH = 'C:/Users/rober/Documents/Unreal Projects'
1013
1114RELEASE_DIR = sys .argv [1 ].rstrip ('/' )
1215
@@ -20,28 +23,27 @@ def msbuild(project, python_version):
2023 base_environ = os .environ
2124 base_environ .update ({'PYTHONHOME' : python_version })
2225 base_environ .update ({'UEP_ENABLE_UNITY_BUILD' : '1' })
23- #vs = '"C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"'
24- vs = '"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe"'
25- process = subprocess .Popen ('{0} {1} /m /t:Rebuild /p:Configuration="Development Editor" /p:Platform=Win64' .format (vs , project ), env = base_environ )
26+ vs = '"{}"' .format (MSBUILD )
27+ process = subprocess .Popen ('{0} "{1}" /m /t:Rebuild /p:Configuration="Development Editor" /p:Platform=Win64' .format (vs , project ), env = base_environ )
2628 while process .poll () is None :
2729 time .sleep (0.5 )
2830 if process .returncode != 0 :
2931 sys .exit (process .returncode )
3032
3133def commandlet (version , project ):
32- ue_editor = os .path .join ('D:/' , 'UE_{0}' .format (version ), 'Engine/Binaries/Win64/UE4Editor-Cmd.exe' )
33- process = subprocess .Popen ('{0} D:/ {1}/{2}.uproject -run=PyCommandlet D:/{3 }/Plugins/UnrealEnginePython/tools/release_check.py' .format (ue_editor , project , project , project ))
34+ ue_editor = os .path .join (UE_PATH , 'UE_{0}' .format (version ), 'Engine/Binaries/Win64/UE4Editor-Cmd.exe' )
35+ process = subprocess .Popen ('{0} {1}/{2}/{3} .uproject -run=PyCommandlet {1}/{4 }/Plugins/UnrealEnginePython/tools/release_check.py' .format (ue_editor , PROJECTS_PATH , project , project , project ))
3436 while process .poll () is None :
3537 time .sleep (0.5 )
3638 # ignore return code, has too much different meanings for commandlets
3739
3840def git (project ):
39- process = subprocess .Popen ('git checkout master' , cwd = 'D:/ {0}/Plugins/UnrealEnginePython' .format (project ))
41+ process = subprocess .Popen ('git checkout master' , cwd = '{0}/{1}/ Plugins/UnrealEnginePython' .format (PROJECTS_PATH , project ))
4042 while process .poll () is None :
4143 time .sleep (0.5 )
4244 if process .returncode != 0 :
4345 sys .exit (process .returncode )
44- process = subprocess .Popen ('git pull' , cwd = 'D:/ {0}/Plugins/UnrealEnginePython' .format (project ))
46+ process = subprocess .Popen ('git pull' , cwd = '{0}/{1}/ Plugins/UnrealEnginePython' .format (PROJECTS_PATH , project ))
4547 while process .poll () is None :
4648 time .sleep (0.5 )
4749 if process .returncode != 0 :
@@ -51,7 +53,7 @@ def git(project):
5153main_start = time .time ()
5254for ue_version in UE_VERSIONS :
5355 project = 'PyTest{0}' .format (ue_version .replace ('.' , '' ))
54- sln = os .path .join ('D:/' , project , '{0}.sln' .format (project ))
56+ sln = os .path .join (PROJECTS_PATH , project , '{0}.sln' .format (project ))
5557 git (project )
5658 for python_version in PYTHON_VERSIONS :
5759 python_sanitized = os .path .basename (python_version ).lower ()
@@ -62,9 +64,9 @@ def git(project):
6264 commandlet (ue_version , project )
6365 end = time .time ()
6466 for item in ('UE4Editor.modules' , 'UE4Editor-UnrealEnginePython.dll' , 'UE4Editor-PythonConsole.dll' , 'UE4Editor-PythonEditor.dll' , 'UE4Editor-PythonAutomation.dll' ):
65- shutil .copyfile ('D:/ {0}/Plugins/UnrealEnginePython/Binaries/Win64/{1 }' .format (project , item ), '{0}/UnrealEnginePython/Binaries/Win64/{1}' .format (RELEASE_DIR , item ))
67+ shutil .copyfile ('{0}/{1}/ Plugins/UnrealEnginePython/Binaries/Win64/{2 }' .format (PROJECTS_PATH , project , item ), '{0}/UnrealEnginePython/Binaries/Win64/{1}' .format (RELEASE_DIR , item ))
6668 if python_sanitized == 'python36' :
67- shutil .copyfile ('D:/ {0}/Plugins/UnrealEnginePython/Binaries/Win64/{1 }' .format (project , item ), '{0}/Embedded/UnrealEnginePython/Binaries/Win64/{1}' .format (RELEASE_DIR , item ))
69+ shutil .copyfile ('{0}/{1}/ Plugins/UnrealEnginePython/Binaries/Win64/{2 }' .format (PROJECTS_PATH , project , item ), '{0}/Embedded/UnrealEnginePython/Binaries/Win64/{1}' .format (RELEASE_DIR , item ))
6870 filename = 'UnrealEnginePython_{0}_{1}_{2}_win64.zip' .format (os .path .basename (RELEASE_DIR ), ue_version .replace ('.' ,'_' ), python_sanitized )
6971 zh = zipfile .ZipFile (os .path .join (RELEASE_DIR , filename ), 'w' , zipfile .ZIP_DEFLATED )
7072 zipdir (os .path .join (RELEASE_DIR , 'UnrealEnginePython' ), zh , RELEASE_DIR )
0 commit comments