pindo 5.13.3 → 5.13.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: 4985e418b092d6dbb035fa1ce8cea6b16daa932f99ca3788c36a9f03a3add641
4
- data.tar.gz: e676532527b67557b27e1998245e1f58ba13e95caeebf5d1a5d9368707814f3d
3
+ metadata.gz: 7b8f4e3397e7d22aee8dd0011d92a8eec9c7cfb8b51b3676a78e518b27c71b25
4
+ data.tar.gz: e8eca26bbd129b1f561d09462f5dde5bedf5059172c711ec01da98427a19f446
5
5
  SHA512:
6
- metadata.gz: 6418c40a1cd24fda9a9867f6f93d9a86ee270b6589f87a468975be3baf322f85572a3d7f0e682e69e280c15368b7500b11dc650efea126d8531c7b317c30a57d
7
- data.tar.gz: 3d926ca53744d46acf95cfcc1ab813ef831d2e9f3cfc5a44de9c936b4c9981830ce59985c459a96b797a89384bd257ff39f281af6b0fe74d98d908f866ffcc0d
6
+ metadata.gz: 2b6e7699071cd70dff2f482105dd93dd3168a962a59b7b477ad4a359f191c0021612ae993d00a024dcf7f38dcd6875a39ef4670131a3c8948038d81d38dbc56c
7
+ data.tar.gz: 20fa09db784a2894e3bc9119f9917a4431031e68fc365b3e77dff1e650b599bfcac8fc5b4914f2e3e87add02ffeec4319c815855fe9e0f77aa1da10288513e87
@@ -15,6 +15,8 @@ require 'pindo/module/task/model/build_task'
15
15
  require 'pindo/module/task/model/jps_upload_task'
16
16
  require 'pindo/options/options'
17
17
  require 'pindo/options/helpers/bundleid_selector'
18
+ require 'pindo/config/build_info_manager'
19
+ require 'pindo/config/ios_config_parser'
18
20
 
19
21
  module Pindo
20
22
  class Command
@@ -246,6 +248,9 @@ module Pindo
246
248
  # Bundle ID 已经通过 value_block 自动获取
247
249
  bundle_id = @args_bundle_id
248
250
 
251
+ # 拉取并加载配置文件到 IosConfigParser
252
+ load_config_file(pindo_project_dir, bundle_id)
253
+
249
254
  # 获取 JPS 配置
250
255
  app_info_obj, workflow_info = PgyerHelper.share_instace.prepare_upload(
251
256
  working_directory: pindo_project_dir,
@@ -261,6 +266,43 @@ module Pindo
261
266
  }
262
267
  end
263
268
 
269
+ # 拉取并加载配置文件
270
+ def load_config_file(project_dir, bundle_id)
271
+ if bundle_id && !bundle_id.empty?
272
+ # 如果指定了 Bundle ID,拉取配置
273
+ puts "\n拉取 Bundle ID 配置: #{bundle_id}"
274
+
275
+ build_info_manager = Pindo::BuildInfoManager.share_instance
276
+ success = build_info_manager.pull_appconfig_with_reponame(
277
+ repo_name: bundle_id,
278
+ target_dir: project_dir
279
+ )
280
+
281
+ unless success
282
+ raise Informative, "拉取配置失败: #{bundle_id}"
283
+ end
284
+
285
+ # 加载拉取的配置到 IosConfigParser
286
+ config_file = File.join(project_dir, "config.json")
287
+ if File.exist?(config_file)
288
+ puts " ✓ 加载配置文件: #{config_file}"
289
+ Pindo::IosConfigParser.instance.load_config(config_file: config_file)
290
+ else
291
+ raise Informative, "配置文件不存在: #{config_file}"
292
+ end
293
+ else
294
+ # 如果没有指定 Bundle ID,使用当前目录的 config.json
295
+ config_file = File.join(project_dir, "config.json")
296
+
297
+ if File.exist?(config_file)
298
+ puts "\n使用当前目录配置文件: #{config_file}"
299
+ Pindo::IosConfigParser.instance.load_config(config_file: config_file)
300
+ else
301
+ raise Informative, "当前目录未找到 config.json 文件,请使用 --bundleid 参数指定 Bundle ID"
302
+ end
303
+ end
304
+ end
305
+
264
306
  end
265
307
  end
266
308
  end
@@ -12,6 +12,8 @@ require 'pindo/module/task/model/build_task'
12
12
  require 'pindo/module/task/model/unity_export_task'
13
13
  require 'pindo/module/task/model/jps_upload_task'
14
14
  require 'pindo/module/task/model/git_tag_task'
15
+ require 'pindo/config/build_info_manager'
16
+ require 'pindo/config/ios_config_parser'
15
17
 
16
18
  module Pindo
17
19
  class Command
@@ -393,6 +395,9 @@ module Pindo
393
395
  end
394
396
  puts " Bundle ID: #{platform_config["bundle_id"]}"
395
397
 
398
+ # 拉取并加载 iOS 配置文件
399
+ prepare_ios_config(platform_config["bundle_id"])
400
+
396
401
  when 'android'
397
402
  # 获取 Android Package Name
398
403
  if @args_bundle_name
@@ -420,6 +425,46 @@ module Pindo
420
425
 
421
426
  private
422
427
 
428
+ # 准备 iOS 配置文件
429
+ # 参考 appstore autobuild 的 prepare_config 方法
430
+ def prepare_ios_config(bundle_id)
431
+ pindo_project_dir = Dir.pwd
432
+
433
+ if bundle_id && !bundle_id.empty?
434
+ # 拉取配置到 Unity 根目录
435
+ puts "\n拉取 iOS Bundle ID 配置: #{bundle_id}"
436
+
437
+ build_info_manager = Pindo::BuildInfoManager.share_instance
438
+ success = build_info_manager.pull_appconfig_with_reponame(
439
+ repo_name: bundle_id,
440
+ target_dir: pindo_project_dir
441
+ )
442
+
443
+ unless success
444
+ raise Informative, "拉取 iOS 配置失败: #{bundle_id}"
445
+ end
446
+
447
+ # 加载拉取的配置到 IosConfigParser
448
+ config_file = File.join(pindo_project_dir, "config.json")
449
+ if File.exist?(config_file)
450
+ puts " ✓ 加载配置文件: #{config_file}"
451
+ Pindo::IosConfigParser.instance.load_config(config_file: config_file)
452
+ else
453
+ raise Informative, "配置文件不存在: #{config_file}"
454
+ end
455
+ else
456
+ # 如果没有指定 Bundle ID,使用当前目录的 config.json
457
+ config_file = File.join(pindo_project_dir, "config.json")
458
+
459
+ if File.exist?(config_file)
460
+ puts "\n使用当前目录配置文件: #{config_file}"
461
+ Pindo::IosConfigParser.instance.load_config(config_file: config_file)
462
+ else
463
+ raise Informative, "当前目录未找到 config.json 文件,请使用 --bundleid 参数指定 Bundle ID"
464
+ end
465
+ end
466
+ end
467
+
423
468
  # 获取 WebGL 包序号
424
469
  def fetch_webgl_index_no(app_info_obj:, workflow_info:)
425
470
  index_count = -1
data/lib/pindo/version.rb CHANGED
@@ -6,7 +6,7 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.13.3"
9
+ VERSION = "5.13.4"
10
10
 
11
11
  class VersionCheck
12
12
  RUBYGEMS_API = 'https://rubygems.org/api/v1/gems/pindo.json'
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.13.3
4
+ version: 5.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade