pindo 5.18.3 → 5.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aa6cacda33572effc137d3edb8cc37b1cf395c200da85365b8f1f975dd8b56a
4
- data.tar.gz: ae49f32ec2d23e85acb5311b9358e8fa2dd0f136c85613401d4053e9538e03a2
3
+ metadata.gz: 57fbad3f66c9cdf2e2dda64e647feeeb46be84b6739ef7140c133855f57d548b
4
+ data.tar.gz: 17f7f6f7bfa9cd4a9353814c64e4eb77f0605a8c92dbd34933370f33f4e5172b
5
5
  SHA512:
6
- metadata.gz: 878e76466b93a3f095b024af378a47b6c54e36d5000455eaf29f07c1b5d6ec1d3ace1b7624a2d3826dc595d976cf030c3e241158e675b74ca8affdca696d7c7a
7
- data.tar.gz: '0769e7e7f5f55836395bedb94f04d5665accb807a88e5c5bbb98f6c0cd92547a62410dfd4ae1a3873e40114d302fcb966f65aaed4d8b8a31e02fa2342b7171c3'
6
+ metadata.gz: 948e941ffb9d6695421264fc413366d07faf0563b224e9b7a0f05370bd98559d1ebd15a99d7b43ef50bb3624a0bea8ffc228331baed069d674532390b6bb5266
7
+ data.tar.gz: d085420dff707aaa1ea8c2a9577c02e7be4b0d753ba9aa6a8bfe141b510835c75407adb11176b533f137b2f71e16893a8cc07faa64d03225bbc4cfb057f7d411
@@ -151,31 +151,35 @@ module Pindo
151
151
  def run
152
152
  pindo_project_dir = Dir.pwd
153
153
 
154
- # 加载 JPS 配置(缓存 project_name,并通过映射表解析 bundle_id)
155
- Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
154
+ begin
155
+ # 加载 JPS 配置(缓存 project_name,并通过映射表解析 bundle_id)
156
+ Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
156
157
 
157
- # 解析 bundle_name(优先级:命令行参数 > JPSBuildConfig映射 > 交互选择)
158
- resolve_bundle_name!
158
+ # 解析 bundle_name(优先级:命令行参数 > JPSBuildConfig映射 > 交互选择)
159
+ resolve_bundle_name!
159
160
 
160
- # 准备配置
161
- config = prepare_android_config(pindo_project_dir)
161
+ # 准备配置
162
+ config = prepare_android_config(pindo_project_dir)
162
163
 
163
- # 创建并执行任务
164
- tasks = make_build_task(config)
164
+ # 创建并执行任务
165
+ tasks = make_build_task(config)
165
166
 
166
- # 添加到任务管理器并执行
167
- task_manager = Pindo::TaskSystem::TaskManager.instance
168
- task_manager.clear_all
169
- tasks.each { |task| task_manager.add_task(task) }
167
+ # 添加到任务管理器并执行
168
+ task_manager = Pindo::TaskSystem::TaskManager.instance
169
+ task_manager.clear_all
170
+ tasks.each { |task| task_manager.add_task(task) }
170
171
 
171
- # 执行任务(根据 --multi 参数决定模式)
172
- if @args_multi_flag
173
- task_manager.start(mode: :concurrent, max_workers: 3)
174
- else
175
- task_manager.start
176
- end
172
+ # 执行任务(根据 --multi 参数决定模式)
173
+ if @args_multi_flag
174
+ task_manager.start(mode: :concurrent, max_workers: 3)
175
+ else
176
+ task_manager.start
177
+ end
177
178
 
178
- system "open #{pindo_project_dir}"
179
+ system "open #{pindo_project_dir}"
180
+ ensure
181
+ Pindo::Options::GlobalOptionsState.instance.clear
182
+ end
179
183
  end
180
184
 
181
185
  private
@@ -172,7 +172,7 @@ module Pindo
172
172
  tasks.each { |task| task_manager.add_task(task) }
173
173
  task_manager.start
174
174
 
175
- # 6. 输出结果
175
+ # 6. 输出结果(任务失败时 start 会自动抛出异常;这里仍要求至少成功一个任务)
176
176
  report = task_manager.execution_report
177
177
  if report[:success] > 0
178
178
  puts "\n✅ 消息发送完成!"
@@ -184,4 +184,4 @@ module Pindo
184
184
  end
185
185
  end
186
186
  end
187
- end
187
+ end
@@ -165,7 +165,7 @@ module Pindo
165
165
  tasks.each { |task| task_manager.add_task(task) }
166
166
  task_manager.start
167
167
 
168
- # 7. 输出结果
168
+ # 7. 输出结果(任务失败时 start 会自动抛出异常;这里仍要求至少成功一个任务)
169
169
  report = task_manager.execution_report
170
170
  if report[:success] > 0
171
171
  puts "\n✅ 绑定完成! 成功绑定 #{app_version_list.size} 个包到 Git Workflow"
@@ -162,7 +162,7 @@ module Pindo
162
162
  tasks.each { |task| task_manager.add_task(task) }
163
163
  task_manager.start
164
164
 
165
- # 输出结果
165
+ # 输出结果(任务失败时 start 会自动抛出异常;这里仍要求至少成功一个任务)
166
166
  report = task_manager.execution_report
167
167
  if report[:success] > 0
168
168
  puts "\n上传完成!"
@@ -25,7 +25,8 @@ module Pindo
25
25
  支持功能:
26
26
 
27
27
  * 上传ipa/apk/app/exe/html安装包
28
- * Unity工程自动检测iOS/Android/WebGL/Windows包
28
+ * Unity工程自动检测iOS/Android/WebGL/macOS/Windows包
29
+ * 通过 --types 指定要上传的包类型(与 unity autobuild 一致)
29
30
  * 添加版本描述
30
31
  * 上传附件
31
32
  * 重签名
@@ -37,6 +38,12 @@ module Pindo
37
38
 
38
39
  $ pindo jps upload path/to/setup.exe # 上传 Windows 安装包
39
40
 
41
+ $ pindo jps upload --types=ipa # 仅上传 IPA
42
+
43
+ $ pindo jps upload --types=ipa,apk # 上传 IPA 和 APK
44
+
45
+ $ pindo jps upload --types=html # 仅上传 WebGL
46
+
40
47
  $ pindo jps upload --proj=demo # 上传到指定项目
41
48
 
42
49
  $ pindo jps upload --desc="版本说明" # 添加版本描述
@@ -59,6 +66,7 @@ module Pindo
59
66
  # 定义此命令使用的参数项
60
67
  def self.option_items
61
68
  @option_items ||= Pindo::Options::OptionGroup.merge(
69
+ Pindo::Options::BuildOptions.select(:types),
62
70
  Pindo::Options::JPSOptions.select(:conf, :send, :desc, :resign),
63
71
  Pindo::Options::GitOptions.all
64
72
  )
@@ -67,18 +75,18 @@ module Pindo
67
75
  def self.options
68
76
  [
69
77
  ['--login', '强制再次登录jps网站'],
70
- ['--ipa', '强制指定上传的ipa文件'],
71
- ['--attach', '指定需要和ipa一起上传的附件'],
78
+ ['--file', '指定要上传的文件路径(支持 ipa/apk/app/exe/html)'],
79
+ ['--attach', '指定需要和安装包一起上传的附件'],
72
80
  ].concat(option_items.map(&:to_claide_option)).concat(super)
73
81
  end
74
82
 
75
83
 
76
84
  def initialize(argv)
77
85
  @args_ipa_file = argv.shift_argument
78
- @ipa_file = argv.option('ipa')
86
+ file_option = argv.option('file') || argv.option('ipa')
79
87
 
80
- if !@ipa_file.nil?
81
- @args_ipa_file = @ipa_file
88
+ if !file_option.nil?
89
+ @args_ipa_file = file_option
82
90
  end
83
91
  if @args_ipa_file && !@args_ipa_file.empty?
84
92
  @args_ipa_file = @args_ipa_file.strip.gsub(/\"/, '')
@@ -90,6 +98,8 @@ module Pindo
90
98
  # 使用 Options 系统解析参数
91
99
  @options = initialize_options(argv)
92
100
 
101
+ @args_types = @options[:types]
102
+
93
103
  # JPS 参数
94
104
  @args_conf = @options[:conf]
95
105
  @args_send_flag = @options[:send] || false
@@ -283,22 +293,39 @@ module Pindo
283
293
  end
284
294
  end
285
295
 
296
+ # 解析 --types 参数,返回允许的类型数组,nil 表示不限制
297
+ def parse_types_filter
298
+ return nil unless @args_types
299
+
300
+ available_types = %w[ipa apk html mac exe]
301
+ types = @args_types.downcase.split(',').map(&:strip)
302
+
303
+ invalid_types = types - available_types
304
+ unless invalid_types.empty?
305
+ raise Informative, "无效的包类型: #{invalid_types.join(', ')}。可用类型: #{available_types.join(', ')}"
306
+ end
307
+
308
+ types
309
+ end
310
+
286
311
  # 查找并确认 Unity 包(可能有多个平台)
287
312
  def find_and_confirm_unity_packages(project_dir, tasks)
313
+ types_filter = parse_types_filter
314
+
288
315
  # 1. 查找所有平台的文件
289
- ios_file = find_unity_ios_package(project_dir)
290
- macos_file = find_unity_macos_package(project_dir)
291
- android_file = find_unity_android_package(project_dir)
292
- webgl_file = find_unity_webgl_package(project_dir)
293
- windows_file = find_unity_windows_package(project_dir)
294
-
295
- # 2. 收集找到的文件
296
- found_files = []
297
- found_files << { file: ios_file, type: 'ipa', name: 'iOS' } if ios_file
298
- found_files << { file: macos_file, type: 'mac', name: 'macOS' } if macos_file
299
- found_files << { file: android_file, type: 'apk', name: 'Android' } if android_file
300
- found_files << { file: webgl_file, type: 'html', name: 'WebGL' } if webgl_file
301
- found_files << { file: windows_file, type: 'exe', name: 'Windows' } if windows_file
316
+ all_candidates = [
317
+ { file: find_unity_ios_package(project_dir), type: 'ipa', name: 'iOS' },
318
+ { file: find_unity_macos_package(project_dir), type: 'mac', name: 'macOS' },
319
+ { file: find_unity_android_package(project_dir), type: 'apk', name: 'Android' },
320
+ { file: find_unity_webgl_package(project_dir), type: 'html', name: 'WebGL' },
321
+ { file: find_unity_windows_package(project_dir), type: 'exe', name: 'Windows' }
322
+ ]
323
+
324
+ # 2. 过滤:去掉未找到的文件,按 --types 过滤
325
+ found_files = all_candidates.select { |info| info[:file] }
326
+ if types_filter
327
+ found_files = found_files.select { |info| types_filter.include?(info[:type]) }
328
+ end
302
329
 
303
330
  # 3. 如果没有找到任何文件,直接返回
304
331
  return if found_files.empty?
@@ -440,10 +467,13 @@ module Pindo
440
467
  windows_files.max_by {|f| File.mtime(f)} if windows_files.any?
441
468
  end
442
469
 
443
- # 确认文件(交互式)
470
+ # 确认文件(交互式,设置 PINDO_AUTO_CONFIRM 时自动确认)
444
471
  def confirm_file(file_path)
445
- answer = agree("需要上传文件: #{file_path} ?(Y/n)")
446
- answer
472
+ if ENV['PINDO_AUTO_CONFIRM'] && !ENV['PINDO_AUTO_CONFIRM'].empty?
473
+ puts "自动确认上传文件: #{file_path}"
474
+ return true
475
+ end
476
+ agree("需要上传文件: #{file_path} ?(Y/n)")
447
477
  end
448
478
 
449
479
  # 根据文件扩展名确定文件类型
@@ -101,7 +101,7 @@ module Pindo
101
101
  # 定义此命令使用的参数项
102
102
  def self.option_items
103
103
  @option_items ||= Pindo::Options::OptionGroup.merge(
104
- Pindo::Options::BuildOptions.select(:bundleid, :bundle_name), # 添加 bundleid 和 bundle_name 参数
104
+ Pindo::Options::BuildOptions.select(:bundleid, :bundle_name, :types),
105
105
  Pindo::Options::JPSOptions.select(:conf, :upload, :send, :media, :bind),
106
106
  Pindo::Options::UnityOptions.select(:skiplib, :skipyoo, :kill_unity),
107
107
  Pindo::Options::UnityOptions.select_with_defaults(skipconfig: true),
@@ -113,7 +113,6 @@ module Pindo
113
113
  # 命令选项
114
114
  def self.options
115
115
  [
116
- ['--types=TYPES', '指定要构建的类型,逗号分隔(如:ipa,apk,html),默认全部类型'],
117
116
  ['--adhoc', '使用AdHoc证书打包iOS(默认使用Dev证书)'],
118
117
  ['--deploy', '使用发布证书打包iOS'],
119
118
  ['--release', '使用Release模式构建Android(默认使用Debug)']
@@ -130,7 +129,7 @@ module Pindo
130
129
  @args_release_flag = argv.flag?('release', false)
131
130
  @args_bundle_id = @options[:bundleid] # 从 @options 获取,确保能被缓存
132
131
  @args_bundle_name = @options[:bundle_name] # 从 @options 获取,确保能被缓存
133
- @args_types = argv.option('types')
132
+ @args_types = @options[:types]
134
133
 
135
134
  # send、media 或 bind 都依赖 upload:如果指定了任一参数,自动启用 upload
136
135
  @args_upload_flag = @options[:send] || @options[:bind] || @options[:media] || @options[:upload]
@@ -201,38 +200,36 @@ module Pindo
201
200
  raise Informative, "当前目录不是Unity工程,请在Unity工程根目录下执行此命令"
202
201
  end
203
202
 
204
- # 加载 JPS 配置(缓存 project_name,并通过映射表解析 bundle_id)
205
- Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
203
+ begin
204
+ # 加载 JPS 配置(缓存 project_name,并通过映射表解析 bundle_id)
205
+ Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
206
206
 
207
- # 1. 获取要构建的类型列表
208
- selected_platforms = get_selected_build_types()
207
+ # 1. 获取要构建的类型列表
208
+ selected_platforms = get_selected_build_types()
209
209
 
210
- # 2. 按平台顺序准备所有配置(iOS → Android → Web)
211
- all_platform_configs = prepare_all_platform_configs(selected_platforms)
210
+ # 2. 按平台顺序准备所有配置(iOS → Android → Web)
211
+ all_platform_configs = prepare_all_platform_configs(selected_platforms)
212
212
 
213
- # 3. 按平台顺序创建所有任务(包含 GitTagTask)
214
- all_tasks = make_task_with_config(selected_platforms, all_platform_configs)
213
+ # 3. 按平台顺序创建所有任务(包含 GitTagTask)
214
+ all_tasks = make_task_with_config(selected_platforms, all_platform_configs)
215
215
 
216
- # 4. 统一添加到任务管理器并执行
217
- task_manager = Pindo::TaskSystem::TaskManager.instance
218
- task_manager.clear_all # 清空之前的任务
216
+ # 4. 统一添加到任务管理器并执行
217
+ task_manager = Pindo::TaskSystem::TaskManager.instance
218
+ task_manager.clear_all # 清空之前的任务
219
219
 
220
- # 按顺序添加所有任务
221
- all_tasks.each do |task|
222
- task_manager.add_task(task)
223
- end
224
-
225
- # # 启用输出管理(自动处理多线程日志隔离)
226
- # task_manager.enable_output_management(
227
- # log_dir: File.join(pindo_project_dir, 'pindo_logs'),
228
- # max_lines_per_task: 0
229
- # )
220
+ # 按顺序添加所有任务
221
+ all_tasks.each do |task|
222
+ task_manager.add_task(task)
223
+ end
230
224
 
231
- # 执行任务(根据 --multi 参数决定模式)
232
- if @args_multi_flag
233
- task_manager.start(mode: :concurrent, max_workers: 3)
234
- else
235
- task_manager.start(mode: :serial)
225
+ # 执行任务(根据 --multi 参数决定模式)
226
+ if @args_multi_flag
227
+ task_manager.start(mode: :concurrent, max_workers: 3)
228
+ else
229
+ task_manager.start(mode: :serial)
230
+ end
231
+ ensure
232
+ Pindo::Options::GlobalOptionsState.instance.clear
236
233
  end
237
234
  end
238
235
 
@@ -594,7 +591,7 @@ module Pindo
594
591
 
595
592
  # prepare_upload 可能会创建/更新 JPSBuildConfig.json(尤其是首次执行)
596
593
  # 这里需要重新加载一次,以便通过映射表解析出 bundleid/bundle_name
597
- Pindo::BuildHelper.share_instance.load_jps_build_config(Dir.pwd)
594
+ Pindo::BuildHelper.share_instance.load_jps_build_config(Dir.pwd, conf: @args_conf)
598
595
 
599
596
  # 保存 app_info_obj 到共享配置(所有平台共享同一个项目)
600
597
  if configs["app_info_obj"].nil?
@@ -154,31 +154,35 @@ module Pindo
154
154
  def run
155
155
  pindo_project_dir = Dir.pwd
156
156
 
157
- # 加载 JPS 配置(如果存在)
158
- Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
157
+ begin
158
+ # 加载 JPS 配置(如果存在)
159
+ Pindo::BuildHelper.share_instance.load_jps_build_config(pindo_project_dir, conf: @args_conf)
159
160
 
160
- # 准备配置
161
- config = prepare_web_config(pindo_project_dir)
161
+ # 准备配置
162
+ config = prepare_web_config(pindo_project_dir)
162
163
 
163
- # 创建并执行任务
164
- tasks = make_build_task(config)
164
+ # 创建并执行任务
165
+ tasks = make_build_task(config)
165
166
 
166
- # 添加到任务管理器并执行
167
- task_manager = Pindo::TaskSystem::TaskManager.instance
168
- task_manager.clear_all
169
- tasks.each { |task| task_manager.add_task(task) }
167
+ # 添加到任务管理器并执行
168
+ task_manager = Pindo::TaskSystem::TaskManager.instance
169
+ task_manager.clear_all
170
+ tasks.each { |task| task_manager.add_task(task) }
170
171
 
171
- # 执行任务(根据 --multi 参数决定模式)
172
- if @args_multi_flag
173
- task_manager.start(mode: :concurrent, max_workers: 3)
174
- else
175
- task_manager.start
176
- end
172
+ # 执行任务(根据 --multi 参数决定模式)
173
+ if @args_multi_flag
174
+ task_manager.start(mode: :concurrent, max_workers: 3)
175
+ else
176
+ task_manager.start
177
+ end
177
178
 
178
- system "open #{pindo_project_dir}"
179
+ system "open #{pindo_project_dir}"
179
180
 
180
- # 可选运行 WebGL
181
- Pindo::Command::Web::Run.run([]) if @args_run_flag
181
+ # 可选运行 WebGL
182
+ Pindo::Command::Web::Run.run([]) if @args_run_flag
183
+ ensure
184
+ Pindo::Options::GlobalOptionsState.instance.clear
185
+ end
182
186
  end
183
187
 
184
188
  private
@@ -237,20 +237,44 @@ module Pindo
237
237
  # 检查 wildcard_bundle_group_name 和 bundle_group_name(兼容旧字段名)
238
238
  wildcard_bundle_group_name = config['wildcard_bundle_group_name'] || config['wildcardBundleId']
239
239
  bundle_group_name = config['bundle_group_name'] || config['bundleId']
240
+ project_id = config['project_id']
240
241
 
241
242
  # 如果缺失,通过 JPS 请求获取并回写
242
243
  if (wildcard_bundle_group_name.nil? || wildcard_bundle_group_name.empty?) ||
243
244
  (bundle_group_name.nil? || bundle_group_name.empty?)
244
- project_id = config['project_id']
245
+
246
+ if ENV['PINDO_DEBUG']
247
+ puts "[PINDO_DEBUG] load_jps_build_config: wildcard_bundle_group_name 或 bundle_group_name 缺失,尝试自动修复"
248
+ puts "[PINDO_DEBUG] wildcard_bundle_group_name=#{wildcard_bundle_group_name.inspect}"
249
+ puts "[PINDO_DEBUG] bundle_group_name=#{bundle_group_name.inspect}"
250
+ puts "[PINDO_DEBUG] project_id=#{project_id.inspect}, project_name=#{project_name.inspect}"
251
+ end
252
+
245
253
  app_info_data = nil
246
254
 
255
+ # 确保 PgyerHelper 已登录,否则 API 调用会因 @pgyer_client 为 nil 而失败
256
+ pgyer_helper = PgyerHelper.share_instace
257
+ pgyer_helper.login
258
+
247
259
  if project_id && !project_id.to_s.empty?
248
- app_info_data = PgyerHelper.share_instace.get_project_detail(project_id: project_id)
260
+ puts "[PINDO_DEBUG] 使用 project_id=#{project_id} 调用 get_project_detail" if ENV['PINDO_DEBUG']
261
+ app_info_data = pgyer_helper.get_project_detail(project_id: project_id)
262
+ puts "[PINDO_DEBUG] get_project_detail 返回: #{app_info_data.nil? ? 'nil' : '有数据'}" if ENV['PINDO_DEBUG']
249
263
  elsif project_name && !project_name.empty?
250
- app_info_data = PgyerHelper.share_instace.find_app_info_with_obj_list(proj_name: project_name)
264
+ puts "[PINDO_DEBUG] 使用 project_name=#{project_name} 调用 find_app_info_with_obj_list" if ENV['PINDO_DEBUG']
265
+ app_info_data = pgyer_helper.find_app_info_with_obj_list(proj_name: project_name)
266
+ puts "[PINDO_DEBUG] find_app_info_with_obj_list 返回: #{app_info_data.nil? ? 'nil' : '有数据'}" if ENV['PINDO_DEBUG']
267
+ else
268
+ puts "[PINDO_DEBUG] project_id 和 project_name 均为空,跳过自动修复" if ENV['PINDO_DEBUG']
251
269
  end
252
270
 
253
271
  if app_info_data
272
+ if ENV['PINDO_DEBUG']
273
+ puts "[PINDO_DEBUG] app_info_data 字段列表: #{app_info_data.keys.join(', ')}"
274
+ puts "[PINDO_DEBUG] wildcardBundleId=#{app_info_data['wildcardBundleId'].inspect}"
275
+ puts "[PINDO_DEBUG] bundleId=#{app_info_data['bundleId'].inspect}"
276
+ end
277
+
254
278
  wildcard_bundle_group_name = app_info_data["wildcardBundleId"]
255
279
  bundle_group_name = app_info_data["bundleId"]
256
280
 
@@ -259,8 +283,14 @@ module Pindo
259
283
  config['bundle_group_name'] = bundle_group_name
260
284
  File.write(config_file, JSON.pretty_generate(config) + "\n")
261
285
  puts "已从 JPS 获取并保存: wildcard_bundle_group_name=#{wildcard_bundle_group_name}, bundle_group_name=#{bundle_group_name}"
286
+ else
287
+ puts "[PINDO_DEBUG] wildcardBundleId 为空,无法自动修复" if ENV['PINDO_DEBUG']
262
288
  end
289
+ else
290
+ puts "[PINDO_DEBUG] 未获取到 app_info_data,自动修复失败" if ENV['PINDO_DEBUG']
263
291
  end
292
+ else
293
+ puts "[PINDO_DEBUG] load_jps_build_config: wildcard_bundle_group_name 和 bundle_group_name 已存在,跳过自动修复" if ENV['PINDO_DEBUG']
264
294
  end
265
295
 
266
296
  # 设置全局状态
@@ -281,6 +311,10 @@ module Pindo
281
311
  return config
282
312
  rescue => e
283
313
  puts "加载 JPSBuildConfig.json 失败: #{e.message}" if ENV['PINDO_VERBOSE'] == '1'
314
+ if ENV['PINDO_DEBUG']
315
+ puts "[PINDO_DEBUG] load_jps_build_config 异常: #{e.class}: #{e.message}"
316
+ puts "[PINDO_DEBUG] #{e.backtrace&.first(5)&.join("\n[PINDO_DEBUG] ")}"
317
+ end
284
318
  end
285
319
  nil
286
320
  end
@@ -56,9 +56,9 @@ module Pindo
56
56
  # - project_name [String] 项目名称
57
57
  # - project_id [String] 项目ID
58
58
  # - workflow_info [Hash] 工作流信息(如果有效)
59
- def try_load_jps_build_config(config_file:, package_type:, manage_type: "")
59
+ def parse_jps_build_config(config_file:, package_type:, manage_type: "")
60
60
  if ENV['PINDO_DEBUG']
61
- puts "\n[PINDO_DEBUG] try_load_jps_build_config 调用:"
61
+ puts "\n[PINDO_DEBUG] parse_jps_build_config 调用:"
62
62
  puts " config_file: #{config_file}"
63
63
  puts " package_type: #{package_type.inspect}"
64
64
  puts " manage_type: #{manage_type.inspect}"
@@ -485,7 +485,7 @@ module Pindo
485
485
 
486
486
  # 尝试从配置文件加载
487
487
  if package_type || manage_type
488
- config_result = try_load_jps_build_config(
488
+ config_result = parse_jps_build_config(
489
489
  config_file: config_path,
490
490
  package_type: package_type,
491
491
  manage_type: manage_type
@@ -120,6 +120,8 @@ module Pindo
120
120
 
121
121
  rescue => e
122
122
  # 任务失败
123
+ task.status = TaskStatus::FAILED
124
+ task.error = e
123
125
  @reporter.print_task_failure(task, e)
124
126
  end
125
127
  end
@@ -117,6 +117,14 @@ module Pindo
117
117
 
118
118
  # 输出执行摘要
119
119
  @reporter.print_execution_summary
120
+
121
+ # 检查失败任务,有失败则抛出异常(确保进程返回非零退出码)
122
+ report = execution_report
123
+ if report[:failed] > 0
124
+ failed_tasks = @queue.completed_snapshot.select { |t| t.status == TaskStatus::FAILED }
125
+ failed_names = failed_tasks.map(&:name).join(', ')
126
+ raise Informative, "#{report[:failed]} 个任务执行失败: #{failed_names}"
127
+ end
120
128
  end
121
129
 
122
130
  # 获取执行报告
@@ -71,6 +71,17 @@ module Pindo
71
71
  env_name: 'PINDO_SCHEME',
72
72
  optional: true,
73
73
  example: 'pindo ios autobuild --scheme=MyAppScheme'
74
+ ),
75
+
76
+ types: OptionItem.new(
77
+ key: :types,
78
+ name: '包类型',
79
+ description: '指定包类型,逗号分隔(ipa,apk,html,mac,exe)',
80
+ type: String,
81
+ env_name: 'PINDO_BUILD_TYPES',
82
+ optional: true,
83
+ cacheable: false,
84
+ example: 'pindo unity autobuild --types=ipa,apk'
74
85
  )
75
86
  }
76
87
  end
data/lib/pindo/version.rb CHANGED
@@ -6,13 +6,13 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.18.3"
9
+ VERSION = "5.18.4"
10
10
 
11
11
  class VersionCheck
12
12
  RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
13
13
  VERSION_INFO_FILE = File.expand_path('~/.pindo/version_info.yml')
14
14
  CHECK_INTERVAL = 5 * 60 * 60 # 5小时检查一次
15
- CONFIG_MIN_VERSION = '1.7.0' # 硬编码的配置版本要求
15
+ CONFIG_MIN_VERSION = '1.8.0' # 硬编码的配置版本要求
16
16
 
17
17
  class << self
18
18
  # 主版本检查方法(保持向后兼容)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.18.3
4
+ version: 5.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade