From 404fd63c03518bde84320c67b7e513691a261b46 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 17 Sep 2023 22:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E8=AE=BA=E5=8F=AF=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E5=BC=80=E5=A7=8B=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Difficult_Rocket/__init__.py | 2 +- docs/src/change_log/build_file.md | 18 +++++++++- libs/utils/nuitka.py | 56 +++++++++++++++---------------- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/Difficult_Rocket/__init__.py b/Difficult_Rocket/__init__.py index 77285ad..8be6877 100644 --- a/Difficult_Rocket/__init__.py +++ b/Difficult_Rocket/__init__.py @@ -11,7 +11,7 @@ from pathlib import Path from Difficult_Rocket.api.types import Options, Version sdk_version = Version("0.8.7.0") # SDK 版本 -build_version = Version("2.1.3.0") # 编译文件版本(与游戏本体无关) +build_version = Version("2.2.0.0") # 编译文件版本(与游戏本体无关) Api_version = Version("0.1.1.0") # API 版本 __version__ = sdk_version diff --git a/docs/src/change_log/build_file.md b/docs/src/change_log/build_file.md index f4a3eae..771afed 100644 --- a/docs/src/change_log/build_file.md +++ b/docs/src/change_log/build_file.md @@ -2,7 +2,23 @@ # DR 构建 更新日志 - 最新构建版本号 - - build_version: 2.1.3.0 + - build_version: 2.2.0.0 + +## 20230917 build 2.2.0.0 + +### 修改 + +- 删掉了蹩脚的 `_add_cmd` + - 可读性更好的写法 + - 反正建议自己去看源码修改 + - 现在应该可以直接运行输出的脚本了 + - 不需要手动给带空格的参数添加引号了 +- 给 `--disable-plugin` 添加了 + - `pyqt5` + - `tk-inter` + - 防止因为 `pyperclicp` 把他俩打包进来 +- 添加了几行 `# noqa` + - 向 linker 低头 ## 20230715 build 2.1.3.0 diff --git a/libs/utils/nuitka.py b/libs/utils/nuitka.py index 3209939..3c30a39 100644 --- a/libs/utils/nuitka.py +++ b/libs/utils/nuitka.py @@ -166,40 +166,40 @@ class CompilerHelper(Options): cmd_list = [self.python_cmd, '-m', 'nuitka'] # macos 和 非 macos icon 参数不同 if platform.system() == 'Darwin': - cmd_list.append(f"--macos-app-version={self.product_version}") - _add_cmd(cmd_list, f'--macos-app-icon={self.icon_path.absolute()}' if self.icon_path else None) + cmd_list += format_cmd('--macos-app-version=', self.product_version, self.product_version) # noqa + cmd_list += format_cmd('--macos-app-icon=', self.icon_path.absolute(), self.icon_path) # noqa elif platform.system() == 'Windows': - _add_cmd(cmd_list, f'--windows-icon-from-ico={self.icon_path.absolute()}' if self.icon_path else None) + cmd_list += format_cmd('--windows-icon-from-ico=', self.icon_path.absolute(), self.icon_path) # noqa elif platform.system() == 'Linux': - _add_cmd(cmd_list, f'--linux-icon={self.icon_path.absolute()}' if self.icon_path else None) + cmd_list += format_cmd('--linux-icon=', self.icon_path.absolute(), self.icon_path) # noqa - _add_cmd(cmd_list, '--lto=yes' if self.use_lto else '--lto=no') - _add_cmd(cmd_list, '--clang' if self.use_clang else None) - _add_cmd(cmd_list, '--msvc=latest' if self.use_msvc else None) - _add_cmd(cmd_list, '--mingw64' if self.use_mingw else None) - _add_cmd(cmd_list, '--standalone' if self.standalone else None) + cmd_list += format_cmd('--lto=', 'yes' if self.use_lto else 'no') + cmd_list += format_cmd('--clang' if self.use_clang else None) + cmd_list += format_cmd('--msvc=latest' if self.use_msvc else None) + cmd_list += format_cmd('--mingw64' if self.use_mingw else None) + cmd_list += format_cmd('--standalone' if self.standalone else None) - _add_cmd(cmd_list, '--disable-ccache' if not self.use_ccache else None) - _add_cmd(cmd_list, '--show-progress' if self.show_progress else None) - _add_cmd(cmd_list, '--show-memory' if self.show_memory else None) - _add_cmd(cmd_list, '--remove-output' if self.remove_output else None) - _add_cmd(cmd_list, '--assume-yes-for-download' if self.download_confirm else None) - _add_cmd(cmd_list, '--run' if self.run_after_build else None) - _add_cmd(cmd_list, '--enable-console' if self.enable_console else '--disable-console') + cmd_list += format_cmd('--disable-ccache' if not self.use_ccache else None) + cmd_list += format_cmd('--show-progress' if self.show_progress else None) + cmd_list += format_cmd('--show-memory' if self.show_memory else None) + cmd_list += format_cmd('--remove-output' if self.remove_output else None) + cmd_list += format_cmd('--assume-yes-for-download' if self.download_confirm else None) + cmd_list += format_cmd('--run' if self.run_after_build else None) + cmd_list += format_cmd('--enable-console' if self.enable_console else '--disable-console') - _add_cmd(cmd_list, f'--xml={self.xml_path.absolute()}' if self.save_xml else None) - _add_cmd(cmd_list, f'--output-dir={self.output_path.absolute()}' if self.output_path else None) - _add_cmd(cmd_list, f'--company-name={self.company_name}' if self.company_name else None) - _add_cmd(cmd_list, f'--product-name={self.product_name}' if self.product_name else None) - _add_cmd(cmd_list, f'--file-version={self.file_version}' if self.file_version else None) - _add_cmd(cmd_list, f'--product-version={self.product_version}' if self.product_version else None) - _add_cmd(cmd_list, f'--file-description={self.file_description}' if self.file_description else None) - _add_cmd(cmd_list, f'--copyright={self.copy_right}' if self.copy_right else None) + cmd_list += format_cmd('--xml=', str(self.xml_path.absolute()), self.save_xml) + cmd_list += format_cmd('--output-dir=', str(self.output_path.absolute()), self.output_path) + cmd_list += format_cmd('--company-name=', self.company_name, self.company_name) + cmd_list += format_cmd('--product-name=', self.product_name, self.product_name) + cmd_list += format_cmd('--file-version=', str(self.file_version), self.file_version) + cmd_list += format_cmd('--product-version=', str(self.product_version), self.product_version) + cmd_list += format_cmd('--file-description=', self.file_description, self.file_description) + cmd_list += format_cmd('--copyright=', self.copy_right, self.copy_right) - _add_cmd(cmd_list, f'--follow-import-to={",".join(self.follow_import)}' if self.follow_import else None) - _add_cmd(cmd_list, f'--nofollow-import-to={",".join(self.no_follow_import)}' if self.no_follow_import else None) - _add_cmd(cmd_list, f'--enable-plugin={",".join(self.enable_plugin)}' if self.enable_plugin else None) - _add_cmd(cmd_list, f'--disable-plugin={",".join(self.disable_plugin)}' if self.disable_plugin else None) + cmd_list += format_cmd('--follow-import-to=', self.follow_import, self.follow_import) + cmd_list += format_cmd('--nofollow-import-to=', self.no_follow_import, self.no_follow_import) + cmd_list += format_cmd('--enable-plugin=', self.enable_plugin, self.enable_plugin) + cmd_list += format_cmd('--disable-plugin=', self.disable_plugin, self.disable_plugin) if self.include_data_dir: cmd_list += [f"--include-data-dir={src}={dst}" for src, dst in self.include_data_dir]