diff --git a/project_exporter.spec b/project_exporter.spec index 9d8dab3..058561b 100644 --- a/project_exporter.spec +++ b/project_exporter.spec @@ -2,49 +2,60 @@ block_cipher = None -a = Analysis(['main.py'], - pathex=[], - binaries=[], - datas=[('HarmonyOS_Sans_SC_Regular.ttf', '.'), ('icon-3种尺寸.ico', '.')], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[('HarmonyOS_Sans_SC_Regular.ttf', '.'), ('icon-3种尺寸.ico', '.'), ('README.md', '.'), ('LICENSE', '.')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - [], - exclude_binaries=True, - name='项目文件导出工具', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=False, - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, - icon='icon-3种尺寸.ico') +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='项目文件导出工具', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon='icon-3种尺寸.ico' +) -coll = COLLECT(exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='项目文件导出工具') +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='项目文件导出工具', +) -app = BUNDLE(coll, - name='项目文件导出工具.app', - icon='icon-3种尺寸.ico', - bundle_identifier=None) +# 仅在 macOS 上添加 BUNDLE +import sys +if sys.platform == 'darwin': + app = BUNDLE( + coll, + name='项目文件导出工具.app', + icon='icon-3种尺寸.ico', + bundle_identifier=None, + )