-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.py
68 lines (59 loc) · 1.93 KB
/
deploy.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from os import getcwd
from os import makedirs
from os.path import basename
from os.path import dirname
from os.path import exists
from os.path import join
from shutil import copyfile
def copy(src, dst):
"""
Copies a file from src to dst. Creates the dst directory it does
not exist already.
:param src: source file
:param dst: destination file
"""
directory = dirname(dst)
if not exists(directory):
makedirs(directory)
try:
copyfile(src, dst)
except IOError as err:
print(str(err))
def main():
"""
This function copies all necessary files needed for deployment
into the specified deployment directory. The paths which might
need to be specified are marked by comments.
"""
qt = "C:/Qt/5.11.2/msvc2017_64" # Qt install directory
deploy = join(getcwd(), "egg-player") # Deployment directory
tree = {
deploy: [
join(getcwd(), "bin/release/egg-player.exe"), # Release exe location
join(getcwd(), "lib/bass-2.4/bin/bass.dll"), # Bass dll location
join(getcwd(), "lib/taglib-1.11.1/bin/tag.dll"), # TagLib dll location
join(qt, "bin/Qt5Core.dll"),
join(qt, "bin/Qt5Gui.dll"),
join(qt, "bin/Qt5Sql.dll"),
join(qt, "bin/Qt5Widgets.dll")
],
join(deploy, "imageformats"): [
join(qt, "plugins/imageformats/qjpeg.dll")
],
join(deploy, "platforms"): [
join(qt, "plugins/platforms/qwindows.dll")
],
join(deploy, "sqldrivers"): [
join(qt, "plugins/sqldrivers/qsqlite.dll")
],
join(deploy, "styles"): [
join(qt, "plugins/styles/qwindowsvistastyle.dll")
]
}
for path, files in tree.items():
for src in files:
dst = join(path, basename(src))
print(src, ">", dst)
copy(src, dst)
if __name__ == "__main__":
main()