-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.spec
More file actions
63 lines (57 loc) · 1.76 KB
/
build.spec
File metadata and controls
63 lines (57 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- mode: python ; coding: utf-8 -*-
specpath = os.path.dirname(os.path.abspath(SPEC))
def get_version():
version_dict = {}
# Path to version.py, assuming build.spec is at the project root
# and version.py is in src/
version_file_path = os.path.join(specpath, "src", "version.py")
with open(version_file_path) as f:
exec(f.read(), version_dict)
return version_dict['__version__']
VERSION = get_version()
a = Analysis(
["src/main.py"], # Path to your main script
pathex=["src"], # Add 'src' to module search path
binaries=[
('src/softcam/', './softcam/')
],
datas=[
('src/resources/', './resources/'), # Bundles the resources folder
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe_obj = EXE(
pyz,
a.scripts,
[], # Let COLLECT handle datas primarily for onedir
name='VCM', # Name of the executable
debug=False,
exclude_binaries=True,
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=os.path.join(specpath, 'src/resources/logo.ico') # Icon for the executable
)
# COLLECT stage for one-dir build
# This creates a folder named 'VCM-{VERSION}' in the 'dist' directory
coll = COLLECT(
exe_obj, # The EXE object created above
a.binaries, # Collect any binaries discovered by Analysis
a.datas, # Collect any datas discovered by Analysis
name=f'VCM-{VERSION}' # This will be the name of the output folder in dist/
)