add xml save support for nuitka build

This commit is contained in:
shenjack 2023-06-14 21:18:04 +08:00
parent a5ee30a534
commit ab6f98c0f3
2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,8 @@ class CompilerHelper(Options):
show_progress: bool = True # --show-progress show_progress: bool = True # --show-progress
show_memory: bool = False # --show-memory 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 download_confirm: bool = True # --assume-yes-for-download
@ -104,6 +106,8 @@ class CompilerHelper(Options):
cmd_list.append('--show-memory') cmd_list.append('--show-memory')
if self.download_confirm: if self.download_confirm:
cmd_list.append('--assume-yes-for-download') 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()}") cmd_list.append(f"--output-dir={self.output_path.absolute()}")

View File

@ -26,15 +26,19 @@ if __name__ == '__main__':
# 修改 python 执行文件 为 运行时的 python # 修改 python 执行文件 为 运行时的 python
compiler.python_cmd = sys.executable compiler.python_cmd = sys.executable
compiler.xml_path = Path(f"./build/compile_data-{time.time()}.xml")
# 检测 --github 参数 # 检测 --github 参数
is_github = False is_github = False
if '--github' in sys.argv: if '--github' in sys.argv:
is_github = True is_github = True
compiler.use_ccache = False compiler.use_ccache = False
compiler.show_memory = False
compiler.show_progress = False compiler.show_progress = False
compiler.output_path = Path('./build/github') compiler.output_path = Path('./build/github')
compiler.python_cmd = 'python' compiler.python_cmd = 'python'
compiler.include_data_dir.remove(('./libs/fonts', './libs/fonts')) compiler.include_data_dir.remove(('./libs/fonts', './libs/fonts'))
compiler.save_xml = False
# 检测 --output xx 参数 # 检测 --output xx 参数
if '--output' in sys.argv: if '--output' in sys.argv: