-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.py
44 lines (33 loc) · 1.02 KB
/
build.py
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
import os
import PyInstaller.__main__
import shutil
from distutils.dir_util import copy_tree
# Opticos Program Builder
program_name = "oiw"
main = "main.py"
version = "1_7 WIN32 build2"
icon = "assets/icon_centered.ico"
folders = ["assets", "ttkbootstrap", "sv_ttk"]
print("\nBuilding Dashboard...")
PyInstaller.__main__.run([
f'{main}',
f'-i={icon}',
'-w',
'-y',
f'-n={program_name}'
])
print(f"\nCreating dist/{program_name}_{version}")
try:
os.mkdir(f"dist/{program_name}_{version}")
except:
print("Deleting Old Build")
shutil.rmtree(f"dist/{program_name}_{version}")
os.mkdir(f"dist/{program_name}_{version}")
print("Copying Assets...")
for folder in folders:
print("Merging:", folder)
shutil.copytree(folder, f"dist/{program_name}_{version}/" + str(folder))
print("Merging: Main...")
copy_tree(f"dist/{program_name}/", f"dist/{program_name}_{version}/")
#print("Merging: Service...")
#copy_tree("dist/GWSL_service/", f"dist/GWSL_{version}/")