-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdodo.py
66 lines (55 loc) · 2.58 KB
/
dodo.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
#######################################################################################
# #
# This file is an equivalent of Makefile. In order to use it, you need to have Python #
# installed together with 'doit' modle. For more information check http://pydoit.org/ #
# #
# Syntax: #
# doit TARGETNAME #
# #
######################################################################################
INSTALLATION_DIR="C:\\Programs\\npackd-repoeditor"
def get_version():
"""Reads version.txt file to obtain version number of the software to be build
"""
with open('version.txt') as fh:
version = fh.read().strip()
return version
def task_version():
"""Creates version.py file based on version.txt
"""
def create_version_file():
version = get_version()
with open('src\\lib\\version.py', 'w') as fh:
fh.write('APP_VERSION = "' + version + '"')
return {
'actions': [create_version_file],
'file_dep': ["version.txt"],
'targets': ["src\\lib\\version.py"],
'clean': True,
}
def task_executable():
"""Compiles executable. It can be found in 'dist' directory.
"""
return {
'actions': ["pyinstaller -w -F -i res/repoeditor.ico src/repoeditor.py"],
'file_dep': ["src\\lib\\version.py"],
'targets': ["dist\\repoeditor.exe"],
'clean': ["rmdir /Q /S dist", "rmdir /Q /S build", "del repoeditor.spec"],
}
def task_installer():
"""Builds installer package which contains executable and other resource files
"""
return {
'actions': ["iscc installer.iss"],
'file_dep': ["dist\\repoeditor.exe"],
'targets': ["installer", "installer\\npackd-repoeditor-" + get_version() + "-setup.exe"],
'clean': True,
}
def task_install():
"""Installs software in the operating system
"""
return {
'actions': ["installer\\npackd-repoeditor-" + get_version() + "-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /DIR=" + INSTALLATION_DIR],
'file_dep': ["installer\\npackd-repoeditor-" + get_version() + "-setup.exe"],
'clean': [INSTALLATION_DIR + "\\unins000.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART"],
}