|
10 | 10 |
|
11 | 11 | RELEASE_DIR = sys.argv[1].rstrip('/') |
12 | 12 |
|
13 | | -def zipdir(path, zh): |
| 13 | +def zipdir(path, zh, base): |
14 | 14 | for root, dirs, files in os.walk(path): |
15 | 15 | for file in files: |
16 | | - zh.write(os.path.join(root, file)) |
| 16 | + filename = os.path.join(root, file) |
| 17 | + zh.write(filename, os.path.relpath(filename, base)) |
17 | 18 |
|
18 | 19 | def msbuild(project, python_version, variant): |
19 | 20 | base_environ = os.environ |
@@ -63,10 +64,17 @@ def git(project): |
63 | 64 | end = time.time() |
64 | 65 | for item in ('UE4Editor.modules', 'UE4Editor-UnrealEnginePython.dll', 'UE4Editor-PythonConsole.dll', 'UE4Editor-PythonEditor.dll'): |
65 | 66 | shutil.copyfile('D:/{0}/Plugins/UnrealEnginePython/Binaries/Win64/{1}'.format(project, item), '{0}/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item)) |
| 67 | + if python_sanitized == 'python36': |
| 68 | + shutil.copyfile('D:/{0}/Plugins/UnrealEnginePython/Binaries/Win64/{1}'.format(project, item), '{0}/Embedded/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item)) |
66 | 69 | filename = 'UnrealEnginePython_{0}_{1}_{2}_{3}win64.zip'.format(os.path.basename(RELEASE_DIR), ue_version.replace('.','_'), python_sanitized, variant) |
67 | 70 | zh = zipfile.ZipFile(os.path.join(RELEASE_DIR, filename), 'w', zipfile.ZIP_DEFLATED) |
68 | | - zipdir(os.path.join(RELEASE_DIR, 'UnrealEnginePython'), zh) |
| 71 | + zipdir(os.path.join(RELEASE_DIR, 'UnrealEnginePython'), zh, RELEASE_DIR) |
69 | 72 | zh.close() |
| 73 | + if python_sanitized == 'python36': |
| 74 | + filename = 'UnrealEnginePython_{0}_{1}_{2}_{3}embedded_win64.zip'.format(os.path.basename(RELEASE_DIR), ue_version.replace('.','_'), python_sanitized, variant) |
| 75 | + zh = zipfile.ZipFile(os.path.join(RELEASE_DIR, filename), 'w', zipfile.ZIP_DEFLATED) |
| 76 | + zipdir(os.path.join(RELEASE_DIR, 'Embedded/UnrealEnginePython'), zh, os.path.join(RELEASE_DIR, 'Embedded')) |
| 77 | + zh.close() |
70 | 78 | print('\n\n***** built {0} for {1} in {2} seconds [{3}]*****\n\n'.format(project, python_version, end-start, filename)) |
71 | 79 |
|
72 | 80 | main_end = time.time() |
|
0 commit comments