-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
55 lines (51 loc) · 1.56 KB
/
tasks.py
File metadata and controls
55 lines (51 loc) · 1.56 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
from datetime import datetime
from invoke import task, Context
from src import (
APP_ORG,
APP_NAME,
APP_CLSID,
APP_REPO_URL,
APP_DESCRIPTION,
APP_RELEASES_URL,
APP_DISPLAY_NAME,
APP_NEW_ISSUE_URL,
APP_USER_MODEL_ID,
APP_VERSION_STRING
)
@task
def build(c: Context, onefile=False):
args = [
'nuitka',
'src',
f'--output-dir=build --output-filename={APP_NAME}',
'--enable-plugin=upx',
'--onefile-no-compression',
'--windows-icon-from-ico=resources/icon.ico',
f'--company-name="{APP_ORG}" --product-name="{APP_DISPLAY_NAME}" --product-version={APP_VERSION_STRING} --file-description="{APP_DISPLAY_NAME} - {APP_DESCRIPTION}" --copyright="Copyright (c) 2025 {APP_ORG}"',
]
if onefile:
args.append('--onefile')
else:
args.append('--standalone')
c.run(' '.join(args))
@task
def create_setup(c: Context):
definitions = {
'NameLong': APP_DISPLAY_NAME,
'Version': APP_VERSION_STRING,
'Description': APP_DESCRIPTION,
'Company': APP_ORG,
'ExeName': f'{APP_NAME}.exe',
'AppUserModelId': APP_USER_MODEL_ID,
'AppUserModelToastActivatorClsid': APP_CLSID,
'Copyright': f'Copyright (c) {datetime.now().year} {APP_ORG}',
'RepoUrl': APP_REPO_URL,
'ReleasesUrl': APP_RELEASES_URL,
'IssuesUrl': APP_NEW_ISSUE_URL
}
cmd = ' '.join([
'iscc.exe',
'setup/setup.iss',
' '.join([f"/d{key}=\"{value}\"" for key, value in definitions.items()])
])
c.run(cmd)