diff options
| author | Stefan Boberg <[email protected]> | 2021-10-05 22:25:53 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-05 22:25:53 +0200 |
| commit | 20ac7384f8ca558f1fb933eda846604792240ea0 (patch) | |
| tree | e5c95b422b847af50b77807af916e389fcaf83aa /scripts/deploybuild.py | |
| parent | stats: Mean returns zero when the count is zero (diff) | |
| download | zen-20ac7384f8ca558f1fb933eda846604792240ea0.tar.xz zen-20ac7384f8ca558f1fb933eda846604792240ea0.zip | |
Merged from upstream
Diffstat (limited to 'scripts/deploybuild.py')
| -rw-r--r-- | scripts/deploybuild.py | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/scripts/deploybuild.py b/scripts/deploybuild.py index 971f34ff9..c81235a8c 100644 --- a/scripts/deploybuild.py +++ b/scripts/deploybuild.py @@ -17,6 +17,10 @@ def jazz_print(tag, detail = ""): def jazz_fail(tag, detail = ""): print(f"{Fore.RED}{Style.BRIGHT}||> {tag}{Style.RESET_ALL} {detail}") +def copy_file(src, dst): + print(f"{Fore.WHITE}{Style.BRIGHT}||> COPY {Style.RESET_ALL} {src} -> {Fore.GREEN}{Style.BRIGHT}{dst}") + shutil.copy(src, dst) + colorama.init() origcwd = os.getcwd() @@ -25,9 +29,13 @@ origcwd = os.getcwd() parser = argparse.ArgumentParser(description='Deploy a zen build to an UE tree') parser.add_argument("root", help="Path to an UE5 root directory") +parser.add_argument("--sentry", action="store_true", help="Whether to upload symobls to Sentry") +parser.add_argument("--xmake", action="store_true", help="Build with XMake") args = parser.parse_args() engineroot = args.root +upload_symbols = args.sentry +use_xmake = args.xmake if not os.path.isfile(os.path.join(engineroot, "RunUAT.bat")): print(f"{Fore.RED}Not a valid UE5 engine root directory: '{engineroot}'") @@ -45,20 +53,29 @@ jazz_print("Zen root:", zenroot) # Build fresh binaries -vs_path = vswhere.get_latest_path() # can also specify prerelease=True -jazz_print("BUILDING CODE", f"using VS root: {vs_path}") -devenv_path = os.path.join(vs_path, "Common7\\IDE\\devenv.com") +if use_xmake: + build_cmd = ["xmake", "-b", "zenserver"] + build_output_dir = r'build\windows\x64\release' +else: + vs_path = vswhere.get_latest_path() # can also specify prerelease=True + jazz_print("BUILDING CODE", f"using VS root: {vs_path}") + devenv_path = os.path.join(vs_path, "Common7\\IDE\\devenv.com") + build_cmd = [devenv_path, "/build", "Release", "zen.sln"] + build_output_dir = r'x64\Release' try: - subprocess.run([devenv_path, "/build", "Release", "zen.sln"], check=True) + subprocess.run(build_cmd, check=True) except: jazz_fail("Build failed!") exit(1) -# Upload symbols etc to Sentry +build_output_binary_path = os.path.join(zenroot, build_output_dir, "zenserver.exe") +build_output_binary_pdb_path = os.path.join(zenroot, build_output_dir, "zenserver.pdb") -jazz_print("Uploading symbols", "to Sentry") -subprocess.run(["scripts\sentry-cli.exe", "upload-dif", "--org", "to", "--project", "zen-server", "x64\\Release\\zenserver.exe", "x64\\Release\\zenserver.pdb"]) +# Upload symbols etc to Sentry +if upload_symbols: + jazz_print("Uploading symbols", "to Sentry") + subprocess.run(["scripts\sentry-cli.exe", "upload-dif", "--org", "to", "--project", "zen-server", build_output_binary_path, build_output_binary_pdb_path]) # Change into root directory to pick up Perforce environment @@ -105,9 +122,9 @@ jazz_print("Placing zenserver", f"executables into tree at '{target_bin_dir}'") crashpadtarget = os.path.join(target_bin_dir, "crashpad_handler.exe") try: - shutil.copy(os.path.join(zenroot, "x64\Release\zenserver.exe"), os.path.join(target_bin_dir, "zenserver.exe")) - shutil.copy(os.path.join(zenroot, "x64\Release\zenserver.pdb"), os.path.join(target_bin_dir, "zenserver.pdb")) - shutil.copy(os.path.join(zenroot, r'vcpkg_installed\x64-windows-static\x64-windows-static\tools\sentry-native\crashpad_handler.exe'), crashpadtarget) + copy_file(build_output_binary_path, os.path.join(target_bin_dir, "zenserver.exe")) + copy_file(build_output_binary_pdb_path, os.path.join(target_bin_dir, "zenserver.pdb")) + copy_file(os.path.join(zenroot, r'vcpkg_installed\x64-windows-static\tools\sentry-native\crashpad_handler.exe'), crashpadtarget) P4.add(crashpadtarget).run() except Exception as e: print(f"Caught exception while copying: {e.args}") |