From ab6f98c0f320f424a3f54ff6e655e6693d8aa10c Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 14 Jun 2023 21:18:04 +0800 Subject: [PATCH] add xml save support for nuitka build --- libs/utils/nuitka.py | 4 ++++ nuitka_build.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libs/utils/nuitka.py b/libs/utils/nuitka.py index eddd864..e473ab2 100644 --- a/libs/utils/nuitka.py +++ b/libs/utils/nuitka.py @@ -31,6 +31,8 @@ class CompilerHelper(Options): show_progress: bool = True # --show-progress show_memory: bool = False # --show-memory + save_xml: bool = True # --xml + xml_path: Path = Path('build/compile_data.xml') download_confirm: bool = True # --assume-yes-for-download @@ -104,6 +106,8 @@ class CompilerHelper(Options): cmd_list.append('--show-memory') if self.download_confirm: cmd_list.append('--assume-yes-for-download') + if self.save_xml: + cmd_list.append(f'--xml={self.xml_path.absolute()}') cmd_list.append(f"--output-dir={self.output_path.absolute()}") diff --git a/nuitka_build.py b/nuitka_build.py index e52fde8..d1d3e01 100644 --- a/nuitka_build.py +++ b/nuitka_build.py @@ -26,15 +26,19 @@ if __name__ == '__main__': # 修改 python 执行文件 为 运行时的 python compiler.python_cmd = sys.executable + compiler.xml_path = Path(f"./build/compile_data-{time.time()}.xml") + # 检测 --github 参数 is_github = False if '--github' in sys.argv: is_github = True compiler.use_ccache = False + compiler.show_memory = False compiler.show_progress = False compiler.output_path = Path('./build/github') compiler.python_cmd = 'python' compiler.include_data_dir.remove(('./libs/fonts', './libs/fonts')) + compiler.save_xml = False # 检测 --output xx 参数 if '--output' in sys.argv: