|
| 1 | +# -*- mode: python ; coding: utf-8 -*- |
| 2 | + |
| 3 | +# This file is part of Slice. |
| 4 | +# |
| 5 | +# Slice is free software: you can redistribute it and/or modify |
| 6 | +# it under the terms of the GNU General Public License as published by |
| 7 | +# the Free Software Foundation, either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | +# |
| 10 | +# Slice is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU General Public License |
| 16 | +# along with Slice. If not, see <https://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +import json |
| 19 | +from pathlib import Path |
| 20 | + |
| 21 | + |
| 22 | +with open(Path("src/build/settings/base.json")) as f: |
| 23 | + base_json = json.load(f) |
| 24 | + VERSION = base_json["version"] |
| 25 | + APP_NAME = base_json["app_name"] |
| 26 | + MAIN_MODULE_PATH = base_json["main_module"] |
| 27 | + |
| 28 | +ICON_PATH = Path("icons/Icon.ico").resolve() |
| 29 | + |
| 30 | +block_cipher = None |
| 31 | + |
| 32 | + |
| 33 | +a = Analysis([Path(MAIN_MODULE_PATH).resolve()], |
| 34 | + pathex=[Path('target/PyInstaller-Windows').resolve()], |
| 35 | + binaries=[], |
| 36 | + datas=[], |
| 37 | + hiddenimports=[], |
| 38 | + hookspath=[], |
| 39 | + runtime_hooks=[], |
| 40 | + excludes=[], |
| 41 | + win_no_prefer_redirects=False, |
| 42 | + win_private_assemblies=False, |
| 43 | + cipher=block_cipher, |
| 44 | + noarchive=False) |
| 45 | +pyz = PYZ(a.pure, a.zipped_data, |
| 46 | + cipher=block_cipher) |
| 47 | +exe = EXE(pyz, |
| 48 | + a.scripts, |
| 49 | + a.binaries, |
| 50 | + a.zipfiles, |
| 51 | + a.datas, |
| 52 | + [], |
| 53 | + name=APP_NAME, |
| 54 | + debug=False, |
| 55 | + bootloader_ignore_signals=False, |
| 56 | + strip=False, |
| 57 | + upx=False, |
| 58 | + console=False , |
| 59 | + runtime_tmpdir=None, |
| 60 | + icon=[str(ICON_PATH)], ) |
0 commit comments