From ebbaf042fb57761565929030fc28af5cee06c6eb Mon Sep 17 00:00:00 2001 From: Zeal-L Date: Sat, 30 Mar 2024 18:34:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20=E6=9B=B4=E6=96=B0=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 7 ++++++- macos.spec | 44 ++++++++++++++++++++++++++++++++++++++++ app.spec => windows.spec | 0 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 macos.spec rename app.spec => windows.spec (100%) diff --git a/build.sh b/build.sh index f5a4dca..677bbe1 100755 --- a/build.sh +++ b/build.sh @@ -9,12 +9,17 @@ echo -e "\033[34m\n 更新现有的依赖包 ... \n\033[0m" poetry update echo -e "\033[34m\n pyinstaller 封装中 ... \n\033[0m" -poetry run pyinstaller app.spec +if [[ "$OSTYPE" == "darwin"* ]]; then + yes | poetry run pyinstaller macos.spec +else + yes | poetry run pyinstaller windows.spec +fi echo -e "\033[34m\n pyinstaller 移动可执行文件到根目录 ... \n\033[0m" cp -r dist/* ./ rm -rf dist rm -rf build +rm -rf output echo -e "\033[32m\n 项目构建完成 ... \n\033[0m" diff --git a/macos.spec b/macos.spec new file mode 100644 index 0000000..7ee96b7 --- /dev/null +++ b/macos.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['./app.py'], + pathex=[], + binaries=[], + datas=[('./src/assets/easy-taskbar-progress.dll', '.')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='哔哩哔哩漫画下载器', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['./src/ui/PySide_src/imgs/BiliBili_favicon.ico'], +) +app = BUNDLE( + exe, + name='哔哩哔哩漫画下载器.app', + icon='./src/ui/PySide_src/imgs/BiliBili_favicon.ico', + bundle_identifier=None, +) diff --git a/app.spec b/windows.spec similarity index 100% rename from app.spec rename to windows.spec