5
5
import shutil
6
6
import zipfile
7
7
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'
10
13
11
14
RELEASE_DIR = sys .argv [1 ].rstrip ('/' )
12
15
@@ -20,28 +23,27 @@ def msbuild(project, python_version):
20
23
base_environ = os .environ
21
24
base_environ .update ({'PYTHONHOME' : python_version })
22
25
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 )
26
28
while process .poll () is None :
27
29
time .sleep (0.5 )
28
30
if process .returncode != 0 :
29
31
sys .exit (process .returncode )
30
32
31
33
def 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 ))
34
36
while process .poll () is None :
35
37
time .sleep (0.5 )
36
38
# ignore return code, has too much different meanings for commandlets
37
39
38
40
def 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 ))
40
42
while process .poll () is None :
41
43
time .sleep (0.5 )
42
44
if process .returncode != 0 :
43
45
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 ))
45
47
while process .poll () is None :
46
48
time .sleep (0.5 )
47
49
if process .returncode != 0 :
@@ -51,7 +53,7 @@ def git(project):
51
53
main_start = time .time ()
52
54
for ue_version in UE_VERSIONS :
53
55
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 ))
55
57
git (project )
56
58
for python_version in PYTHON_VERSIONS :
57
59
python_sanitized = os .path .basename (python_version ).lower ()
@@ -62,9 +64,9 @@ def git(project):
62
64
commandlet (ue_version , project )
63
65
end = time .time ()
64
66
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 ))
66
68
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 ))
68
70
filename = 'UnrealEnginePython_{0}_{1}_{2}_win64.zip' .format (os .path .basename (RELEASE_DIR ), ue_version .replace ('.' ,'_' ), python_sanitized )
69
71
zh = zipfile .ZipFile (os .path .join (RELEASE_DIR , filename ), 'w' , zipfile .ZIP_DEFLATED )
70
72
zipdir (os .path .join (RELEASE_DIR , 'UnrealEnginePython' ), zh , RELEASE_DIR )
0 commit comments