Skip to content

Commit 07d8f2b

Browse files
committed
update nuitka_config
1 parent f7fe300 commit 07d8f2b

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

package/nuitka_build.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def main():
110110
task = MyDict(task)
111111
try:
112112
print(f"\n{'='*40}")
113-
print(f"开始打包任务: [{i}/{len(config)}] {name}")
113+
print(f"开始打包任务: [{i}/{len(config)}] {task.get('name')}")
114114
print(f"{'='*40}")
115115

116116
# 解析任务参数 - 使用路径规范化
@@ -119,10 +119,11 @@ def main():
119119
requirements = task.get('install-requirements', [])
120120
enable_plugins = task.get('enable-plugins', [])
121121

122-
icon = task.get('icon')
122+
# icon = task.get('icon')
123123
name = task.get('name')
124124
version = task.get('version')
125125
timeout = task.get('timeout', 60 * 45)
126+
os_list = task.get('os-list', ['Linux','Windows'])
126127

127128
# c-compiler
128129
# c_compiler_clang = task.get('c-compiler', {}).get('clang', False)
@@ -155,8 +156,8 @@ def main():
155156
only_windows_command = task.get('only-windows-command')
156157
clean_cache = task.get('clean-cache')
157158

158-
if Machine not in task.get('os', ['Windows','Linux']):
159-
print(f"警告: 任务 [{i}/{len(config)} {name}] 不支持当前操作系统 {Machine}")
159+
if system_os not in os_list:
160+
print(f"警告: 任务 [{i}/{len(config)}] {name} 不支持当前操作系统 {system_os}")
160161
task_error_list.append(name)
161162
continue
162163

@@ -305,10 +306,10 @@ def main():
305306
shutil.rmtree(temp_output_path)
306307

307308
except Exception as e:
308-
print(f"任务[{i}/{len(config)} {name}]失败: {str(e)}")
309+
print(f"任务[{i}/{len(config)} {task.get('name')}]失败: {str(e)}")
309310
import traceback
310311
traceback.print_exc()
311-
task_error_list.append(name)
312+
task_error_list.append(task.get('name'))
312313

313314
# 输出最终结果
314315
print("\n" + "="*50)

package/nuitka_config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# onefile: 2 # 0:文件夹 1:单文件 2:两者
1515
# distpath: 'dist'
1616
timeout: 2700
17+
os-list:
18+
- 'Linux'
19+
- 'Windows'
1720
custom-command: []
1821
only-linux-command: []
1922
only-windows-command: []
@@ -47,6 +50,9 @@
4750
windows-disable-console: False
4851
# distpath: 'dist'
4952
timeout: 2700
53+
os-list:
54+
- 'Linux'
55+
- 'Windows'
5056
custom-command: []
5157
only-linux-command: []
5258
only-windows-command: []
@@ -80,6 +86,9 @@
8086
windows-disable-console: False
8187
# distpath: 'dist'
8288
timeout: 2700
89+
os-list:
90+
- 'Linux'
91+
- 'Windows'
8392
custom-command: []
8493
only-linux-command: []
8594
only-windows-command: []
@@ -110,6 +119,9 @@
110119
windows-disable-console: False
111120
# distpath: 'dist'
112121
timeout: 2700
122+
os-list:
123+
- 'Linux'
124+
- 'Windows'
113125
custom-command: []
114126
only-linux-command: []
115127
only-windows-command: []
@@ -141,6 +153,9 @@
141153
windows-disable-console: False
142154
# distpath: 'dist'
143155
timeout: 2700
156+
os-list:
157+
- 'Linux'
158+
- 'Windows'
144159
custom-command: []
145160
only-linux-command: []
146161
only-windows-command: []

package/nuitka_test_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# distpath: 'dist'
1212
timeout: 2700
1313
custom-command: []
14+
os-list:
15+
- 'Linux'
16+
- 'Windows'
1417
only-linux-command: []
1518
only-windows-command: []
1619
clean-cache: # 禁用选定的缓存,设置"all"则为所有缓存。当前允许的值有:"all(全部)","ccache","bytecode(字节码)","compression(压缩)","dll-dependencies(dll依赖项)"。

0 commit comments

Comments
 (0)