pindo 5.10.9 → 5.11.1

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pindo/command/android/autobuild.rb +38 -22
  3. data/lib/pindo/command/android/autoresign.rb +332 -0
  4. data/lib/pindo/command/android/build.rb +19 -12
  5. data/lib/pindo/command/android/{debug.rb → keystore.rb} +20 -25
  6. data/lib/pindo/command/android.rb +4 -3
  7. data/lib/pindo/command/{ipa/output.rb → appstore/adhocbuild.rb} +17 -17
  8. data/lib/pindo/command/{ipa → appstore}/autoresign.rb +11 -11
  9. data/lib/pindo/command/appstore/iap.rb +8 -8
  10. data/lib/pindo/command/{ipa → appstore}/import.rb +18 -18
  11. data/lib/pindo/command/appstore/itcapp.rb +8 -8
  12. data/lib/pindo/command/appstore/metadata.rb +8 -8
  13. data/lib/pindo/command/appstore/screenshots.rb +8 -8
  14. data/lib/pindo/command/appstore/upload.rb +8 -8
  15. data/lib/pindo/command/appstore.rb +6 -2
  16. data/lib/pindo/command/deploy/bundleid.rb +8 -8
  17. data/lib/pindo/command/deploy/cert.rb +10 -10
  18. data/lib/pindo/command/deploy/check.rb +8 -8
  19. data/lib/pindo/command/deploy.rb +1 -3
  20. data/lib/pindo/command/env/dreamstudio.rb +14 -12
  21. data/lib/pindo/command/env/quarkenv.rb +13 -11
  22. data/lib/pindo/command/env/swarkenv.rb +13 -11
  23. data/lib/pindo/command/env/workhard.rb +14 -12
  24. data/lib/pindo/command/env.rb +1 -1
  25. data/lib/pindo/command/gplay.rb +1 -1
  26. data/lib/pindo/command/ios/autobuild.rb +23 -15
  27. data/lib/pindo/command/ios/autoresign.rb +16 -16
  28. data/lib/pindo/command/ios/build.rb +12 -10
  29. data/lib/pindo/command/ios/{debug.rb → cert.rb} +26 -27
  30. data/lib/pindo/command/{lib/lint.rb → ios/podlint.rb} +6 -6
  31. data/lib/pindo/command/{lib/forcepush.rb → ios/podpush.rb} +123 -23
  32. data/lib/pindo/command/{lib/update.rb → ios/podupdate.rb} +5 -5
  33. data/lib/pindo/command/ios.rb +6 -2
  34. data/lib/pindo/command/jps/upload.rb +1 -1
  35. data/lib/pindo/command/jps.rb +1 -1
  36. data/lib/pindo/command/repo.rb +1 -1
  37. data/lib/pindo/command/unity/apk.rb +20 -15
  38. data/lib/pindo/command/unity/autobuild.rb +15 -21
  39. data/lib/pindo/command/unity/ipa.rb +21 -17
  40. data/lib/pindo/command/unity/{pack.rb → packbuild.rb} +17 -10
  41. data/lib/pindo/command/unity/{initpack.rb → packinit.rb} +10 -16
  42. data/lib/pindo/command/unity/{upload.rb → packpush.rb} +13 -19
  43. data/lib/pindo/command/unity/web.rb +19 -13
  44. data/lib/pindo/command/unity.rb +4 -4
  45. data/lib/pindo/command/{dev → utils}/feishu.rb +14 -14
  46. data/lib/pindo/command/{dev → utils}/repoinit.rb +8 -8
  47. data/lib/pindo/command/{dev → utils}/tag.rb +19 -19
  48. data/lib/pindo/command/utils.rb +9 -6
  49. data/lib/pindo/command/web/autobuild.rb +1 -1
  50. data/lib/pindo/command/web.rb +1 -1
  51. data/lib/pindo/command.rb +1 -4
  52. data/lib/pindo/module/android/android_build_config_helper.rb +83 -10
  53. data/lib/pindo/version.rb +1 -1
  54. metadata +16 -22
  55. data/lib/pindo/command/dev.rb +0 -21
  56. data/lib/pindo/command/feishu/send_message.rb +0 -103
  57. data/lib/pindo/command/feishu.rb +0 -50
  58. data/lib/pindo/command/ios/adhoc.rb +0 -245
  59. data/lib/pindo/command/ipa.rb +0 -16
  60. data/lib/pindo/command/lib/push.rb +0 -157
  61. data/lib/pindo/command/lib.rb +0 -16
@@ -23,7 +23,7 @@ module Pindo
23
23
  app_id_suffix = workflow_packname.gsub(/[^a-zA-Z0-9]/, '').downcase
24
24
  application_id = "com.heroneverdie101.#{app_id_suffix}"
25
25
  package_scheme = workflow_packname.gsub(/[^a-zA-Z0-9]/, '').downcase
26
- bundle_scheme = application_id.gsub(/[^a-zA-Z0-9]/, '').downcase
26
+ # bundle_scheme 现在在 update_application_id 中处理
27
27
 
28
28
  # 1. 更新 App Name
29
29
  success_app_name = update_app_name_with_packagename(
@@ -46,16 +46,10 @@ module Pindo
46
46
  puts " ✓ 已添加Scheme: #{package_scheme} (基于 Package Name)"
47
47
  end
48
48
 
49
- # 4. 添加基于 Application ID 的 Scheme
50
- success_bundle_scheme = add_test_scheme(
51
- project_dir: project_dir,
52
- scheme_name: bundle_scheme
53
- )
54
- if success_bundle_scheme
55
- puts " ✓ 已添加Scheme: #{bundle_scheme} (基于 Application ID)"
56
- end
49
+ # 注意:基于 Application ID 的 Scheme 将在 update_application_id 方法中添加
50
+ # 因为 Application ID 可能在后续流程中被覆盖
57
51
 
58
- return success_app_name && success_app_id && success_package_scheme && success_bundle_scheme
52
+ return success_app_name && success_app_id && success_package_scheme
59
53
  end
60
54
 
61
55
  # 更新Android工程版本号
@@ -539,6 +533,85 @@ module Pindo
539
533
  end
540
534
  end
541
535
 
536
+ # 添加基于 Application ID 的 Scheme
537
+ # 读取当前项目的 Application ID 并添加对应的 Scheme
538
+ # @param project_dir [String] Android项目目录路径
539
+ # @return [Boolean] 是否成功添加
540
+ def self.add_application_id_based_scheme(project_dir: nil)
541
+ # 参数验证
542
+ if project_dir.nil? || !File.directory?(project_dir)
543
+ Funlog.instance.fancyinfo_error("项目路径无效: #{project_dir}")
544
+ return false
545
+ end
546
+
547
+ begin
548
+ # 获取主模块
549
+ main_module = Pindo::AndroidProjectHelper.get_main_module(project_dir)
550
+
551
+ # 支持多种项目结构
552
+ module_paths = []
553
+ module_paths << File.join(project_dir, main_module) if main_module
554
+ module_paths << File.join(project_dir, "app")
555
+ module_paths << File.join(project_dir, "unityLibrary/launcher")
556
+ module_paths << File.join(project_dir, "launcher")
557
+
558
+ gradle_file = nil
559
+ module_paths.each do |module_path|
560
+ next unless File.exist?(module_path)
561
+
562
+ if File.exist?(File.join(module_path, "build.gradle"))
563
+ gradle_file = File.join(module_path, "build.gradle")
564
+ break
565
+ elsif File.exist?(File.join(module_path, "build.gradle.kts"))
566
+ gradle_file = File.join(module_path, "build.gradle.kts")
567
+ break
568
+ end
569
+ end
570
+
571
+ if gradle_file.nil?
572
+ Funlog.instance.fancyinfo_error("未找到build.gradle文件,无法读取 Application ID")
573
+ return false
574
+ end
575
+
576
+ # 读取gradle文件,提取当前的 Application ID
577
+ content = File.read(gradle_file)
578
+ application_id = nil
579
+
580
+ # 匹配各种 applicationId 格式
581
+ if content =~ /applicationId\s+["']([^"']+)["']/
582
+ application_id = $1
583
+ elsif content =~ /applicationId\s*=\s*["']([^"']+)["']/
584
+ application_id = $1
585
+ end
586
+
587
+ if application_id.nil?
588
+ Funlog.instance.fancyinfo_error("无法从 gradle 文件中读取 Application ID")
589
+ return false
590
+ end
591
+
592
+ # 将 Application ID 转换为合法的 scheme 名称(只保留字母和数字)
593
+ bundle_scheme = application_id.gsub(/[^a-zA-Z0-9]/, '').downcase
594
+
595
+ # 添加 Scheme
596
+ success_scheme = add_test_scheme(
597
+ project_dir: project_dir,
598
+ scheme_name: bundle_scheme
599
+ )
600
+
601
+ if success_scheme
602
+ puts " ✓ 已添加Scheme: #{bundle_scheme} (基于 Application ID: #{application_id})"
603
+ return true
604
+ else
605
+ Funlog.instance.fancyinfo_error("添加 Scheme 失败: #{bundle_scheme}")
606
+ return false
607
+ end
608
+
609
+ rescue StandardError => e
610
+ Funlog.instance.fancyinfo_error("添加基于 Application ID 的 Scheme 失败: #{e.message}")
611
+ return false
612
+ end
613
+ end
614
+
542
615
  # 添加测试scheme到Android工程
543
616
  # @param project_dir [String] Android项目目录路径
544
617
  # @param scheme_name [String] 要添加的scheme名称
data/lib/pindo/version.rb CHANGED
@@ -6,7 +6,7 @@ require 'time'
6
6
 
7
7
  module Pindo
8
8
 
9
- VERSION = "5.10.9"
9
+ VERSION = "5.11.1"
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.10.9
4
+ version: 5.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade
@@ -314,10 +314,14 @@ files:
314
314
  - lib/pindo/command.rb
315
315
  - lib/pindo/command/android.rb
316
316
  - lib/pindo/command/android/autobuild.rb
317
+ - lib/pindo/command/android/autoresign.rb
317
318
  - lib/pindo/command/android/build.rb
318
- - lib/pindo/command/android/debug.rb
319
+ - lib/pindo/command/android/keystore.rb
319
320
  - lib/pindo/command/appstore.rb
321
+ - lib/pindo/command/appstore/adhocbuild.rb
322
+ - lib/pindo/command/appstore/autoresign.rb
320
323
  - lib/pindo/command/appstore/iap.rb
324
+ - lib/pindo/command/appstore/import.rb
321
325
  - lib/pindo/command/appstore/itcapp.rb
322
326
  - lib/pindo/command/appstore/metadata.rb
323
327
  - lib/pindo/command/appstore/screenshots.rb
@@ -346,20 +350,14 @@ files:
346
350
  - lib/pindo/command/deploy/tag.rb
347
351
  - lib/pindo/command/deploy/updateconfig.rb
348
352
  - lib/pindo/command/deploy/uploadipa.rb
349
- - lib/pindo/command/dev.rb
350
353
  - lib/pindo/command/dev/autobuild.rb
351
354
  - lib/pindo/command/dev/build.rb
352
355
  - lib/pindo/command/dev/debug.rb
353
- - lib/pindo/command/dev/feishu.rb
354
- - lib/pindo/command/dev/repoinit.rb
355
- - lib/pindo/command/dev/tag.rb
356
356
  - lib/pindo/command/env.rb
357
357
  - lib/pindo/command/env/dreamstudio.rb
358
358
  - lib/pindo/command/env/quarkenv.rb
359
359
  - lib/pindo/command/env/swarkenv.rb
360
360
  - lib/pindo/command/env/workhard.rb
361
- - lib/pindo/command/feishu.rb
362
- - lib/pindo/command/feishu/send_message.rb
363
361
  - lib/pindo/command/gplay.rb
364
362
  - lib/pindo/command/gplay/iap.rb
365
363
  - lib/pindo/command/gplay/itcapp.rb
@@ -368,16 +366,14 @@ files:
368
366
  - lib/pindo/command/gplay/screenshots.rb
369
367
  - lib/pindo/command/gplay/upload.rb
370
368
  - lib/pindo/command/ios.rb
371
- - lib/pindo/command/ios/adhoc.rb
372
369
  - lib/pindo/command/ios/applovin.rb
373
370
  - lib/pindo/command/ios/autobuild.rb
374
371
  - lib/pindo/command/ios/autoresign.rb
375
372
  - lib/pindo/command/ios/build.rb
376
- - lib/pindo/command/ios/debug.rb
377
- - lib/pindo/command/ipa.rb
378
- - lib/pindo/command/ipa/autoresign.rb
379
- - lib/pindo/command/ipa/import.rb
380
- - lib/pindo/command/ipa/output.rb
373
+ - lib/pindo/command/ios/cert.rb
374
+ - lib/pindo/command/ios/podlint.rb
375
+ - lib/pindo/command/ios/podpush.rb
376
+ - lib/pindo/command/ios/podupdate.rb
381
377
  - lib/pindo/command/jps.rb
382
378
  - lib/pindo/command/jps/apptest.rb
383
379
  - lib/pindo/command/jps/bind.rb
@@ -386,11 +382,6 @@ files:
386
382
  - lib/pindo/command/jps/login.rb
387
383
  - lib/pindo/command/jps/resign.rb
388
384
  - lib/pindo/command/jps/upload.rb
389
- - lib/pindo/command/lib.rb
390
- - lib/pindo/command/lib/forcepush.rb
391
- - lib/pindo/command/lib/lint.rb
392
- - lib/pindo/command/lib/push.rb
393
- - lib/pindo/command/lib/update.rb
394
385
  - lib/pindo/command/repo.rb
395
386
  - lib/pindo/command/repo/clone.rb
396
387
  - lib/pindo/command/repo/create.rb
@@ -400,18 +391,21 @@ files:
400
391
  - lib/pindo/command/unity.rb
401
392
  - lib/pindo/command/unity/apk.rb
402
393
  - lib/pindo/command/unity/autobuild.rb
403
- - lib/pindo/command/unity/initpack.rb
404
394
  - lib/pindo/command/unity/ipa.rb
405
- - lib/pindo/command/unity/pack.rb
406
- - lib/pindo/command/unity/upload.rb
395
+ - lib/pindo/command/unity/packbuild.rb
396
+ - lib/pindo/command/unity/packinit.rb
397
+ - lib/pindo/command/unity/packpush.rb
407
398
  - lib/pindo/command/unity/web.rb
408
399
  - lib/pindo/command/utils.rb
409
400
  - lib/pindo/command/utils/boss.rb
410
401
  - lib/pindo/command/utils/clearcert.rb
411
402
  - lib/pindo/command/utils/device.rb
403
+ - lib/pindo/command/utils/feishu.rb
412
404
  - lib/pindo/command/utils/icon.rb
413
405
  - lib/pindo/command/utils/renewcert.rb
414
406
  - lib/pindo/command/utils/renewproj.rb
407
+ - lib/pindo/command/utils/repoinit.rb
408
+ - lib/pindo/command/utils/tag.rb
415
409
  - lib/pindo/command/utils/tgate.rb
416
410
  - lib/pindo/command/utils/xcassets.rb
417
411
  - lib/pindo/command/utils/xcassets.sh
@@ -1,21 +0,0 @@
1
- # require 'pindo/command/dev/create'
2
-
3
-
4
- require 'pindo/command/dev/tag'
5
- require 'pindo/command/dev/debug'
6
- require 'pindo/command/dev/autobuild'
7
- require 'pindo/command/dev/build'
8
- require 'pindo/command/dev/repoinit'
9
- require 'pindo/command/dev/feishu'
10
-
11
- module Pindo
12
- class Command
13
-
14
- class Dev < Command
15
- self.abstract_command = true
16
- self.summary = '开发阶段使用的相关命令'
17
-
18
- end
19
-
20
- end
21
- end
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'json'
4
- require 'net/http'
5
- require 'uri'
6
- require 'pindo/client/httpclient'
7
-
8
- module Pindo
9
- module Command
10
- module Feishu
11
- class SendMessage
12
- def self.run(options)
13
- new(options).run
14
- end
15
-
16
- def initialize(options)
17
- @options = options
18
- @webhook_url = options[:webhook_url]
19
- @message = options[:message]
20
- @title = options[:title] || "通知"
21
- @at_all = options[:at_all] || false
22
- end
23
-
24
- def run
25
- unless @webhook_url
26
- puts "错误:未提供飞书 webhook URL"
27
- return false
28
- end
29
-
30
- unless @message
31
- puts "错误:未提供消息内容"
32
- return false
33
- end
34
-
35
- send_message
36
- end
37
-
38
- private
39
-
40
- def send_message
41
- uri = URI(@webhook_url)
42
-
43
- # 构建消息内容
44
- content = {
45
- "msg_type": "post",
46
- "content": {
47
- "post": {
48
- "zh_cn": {
49
- "title": @title,
50
- "content": [
51
- [
52
- {
53
- "tag": "text",
54
- "text": @message
55
- }
56
- ]
57
- ]
58
- }
59
- }
60
- }
61
- }
62
-
63
- # 如果需要@所有人
64
- if @at_all
65
- content[:content][:post][:zh_cn][:content][0].unshift(
66
- {
67
- "tag": "at",
68
- "user_id": "all"
69
- }
70
- )
71
- end
72
-
73
- # 发送请求
74
- begin
75
- con = HttpClient.create_instance_with_proxy
76
- res = con.post do |req|
77
- req.url uri
78
- req.headers['Content-Type'] = 'application/json'
79
- req.body = content.to_json
80
- end
81
-
82
- if res.status == 200
83
- result = JSON.parse(res.body)
84
- if result['code'] == 0
85
- puts "消息发送成功!"
86
- return true
87
- else
88
- puts "消息发送失败:#{result['msg']}"
89
- return false
90
- end
91
- else
92
- puts "消息发送失败:HTTP #{res.status}"
93
- return false
94
- end
95
- rescue => e
96
- puts "发送消息时出错:#{e.message}"
97
- return false
98
- end
99
- end
100
- end
101
- end
102
- end
103
- end
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'claide'
4
- require 'pindo/command/feishu/send_message'
5
-
6
- module Pindo
7
- module Command
8
- class Feishu < CLAide::Command
9
- self.description = '飞书相关命令'
10
- self.command = 'feishu'
11
- self.abstract_command = true
12
-
13
- def self.options
14
- [
15
- ['--webhook-url=URL', '飞书 webhook URL'],
16
- ['--message=MESSAGE', '要发送的消息内容'],
17
- ['--title=TITLE', '消息标题(可选)'],
18
- ['--at-all', '是否@所有人(可选)']
19
- ]
20
- end
21
-
22
- def initialize(argv)
23
- super
24
- @webhook_url = argv.option('webhook-url')
25
- @message = argv.option('message')
26
- @title = argv.option('title')
27
- @at_all = argv.flag?('at-all')
28
- end
29
-
30
- def validate!
31
- super
32
- unless @webhook_url
33
- help! '必须提供 webhook URL'
34
- end
35
- unless @message
36
- help! '必须提供消息内容'
37
- end
38
- end
39
-
40
- def run
41
- Pindo::Command::Feishu::SendMessage.run(
42
- webhook_url: @webhook_url,
43
- message: @message,
44
- title: @title,
45
- at_all: @at_all
46
- )
47
- end
48
- end
49
- end
50
- end
@@ -1,245 +0,0 @@
1
- require 'highline/import'
2
- require 'xcodeproj'
3
- require 'find'
4
- require 'fileutils'
5
- require 'pindo/base/executable'
6
- require 'pindo/module/xcode/xcode_build_config'
7
-
8
- module Pindo
9
- class Command
10
- class Ios < Command
11
- class Adhoc < Ios
12
-
13
- include Appselect
14
-
15
- # 命令的简要说明 - 设置开发环境并编译iOS工程
16
- self.summary = '设置开发环境并编译iOS工程'
17
-
18
- # 命令的详细说明,包含用法示例
19
- self.description = <<-DESC
20
- 设置开发环境并编译iOS工程。
21
-
22
- 支持功能:
23
-
24
- * 自动设置开发环境
25
-
26
- * 编译打包上传
27
-
28
- * 发送测试通知
29
-
30
- 使用示例:
31
-
32
- $ pindo ios adhoc # 设置开发环境
33
-
34
- $ pindo ios adhoc --upload # 编译并上传
35
-
36
- $ pindo ios adhoc --send # 编译并上传并发送通知
37
-
38
- $ pindo ios adhoc --proj=myapp # 指定项目名称
39
- DESC
40
-
41
- # 命令的参数列表
42
- self.arguments = [
43
-
44
- ]
45
-
46
- # 命令的选项列表
47
- def self.options
48
- [
49
- # 指定上传到JPS的项目
50
- ['--proj', '指定上传到测试平台的项目名称'],
51
- # 上传编译包
52
- ['--upload', '上传编译后的ipa到测试平台'],
53
- # 发送通知
54
- ['--send', '上传成功后发送测试通知']
55
- ].concat(super)
56
- end
57
-
58
- def initialize(argv)
59
-
60
- @args_deploy_flag = argv.flag?('deploy', false)
61
- @args_adhoc_flag = argv.flag?('adhoc', false)
62
- @args_upload_flag = argv.flag?('upload', false)
63
- @args_send_flag = argv.flag?('send', false)
64
- @args_proj_name = argv.option('proj')
65
-
66
- if @args_send_flag
67
- @args_upload_flag = true
68
- end
69
-
70
- super
71
- @additional_args = argv.remainder!
72
- end
73
-
74
- def validate!
75
-
76
- super
77
- end
78
-
79
- def run
80
-
81
- project_dir = Dir.pwd
82
-
83
- app_info_obj = nil
84
- workflow_info = nil
85
- if @args_upload_flag
86
- proj_name = @args_proj_name
87
- # 传入 package_type 获取 workflow_info
88
- app_info_obj, workflow_info = PgyerHelper.share_instace.prepare_upload(
89
- working_directory: Dir.pwd,
90
- proj_name: proj_name,
91
- package_type: 'ipa'
92
- )
93
-
94
- # ===== 使用 workflow 配置更新项目 =====
95
- if workflow_info && workflow_info[:package_name]
96
- workflow_packname = workflow_info[:package_name]
97
-
98
- puts "\n使用工作流配置更新 iOS 项目:"
99
- puts " Workflow Package Name: #{workflow_packname}"
100
-
101
- # 一次性更新 Display Name、Bundle ID 和 URL Schemes
102
- Pindo::XcodeBuildConfig.update_project_with_workflow(
103
- project_dir: project_dir,
104
- workflow_packname: workflow_packname
105
- )
106
- else
107
- raise Informative, "未获取到工作流信息"
108
- end
109
- end
110
-
111
- mainapp_bundleid= nil
112
- if @args_deploy_flag
113
- mainapp_bundleid = get_selected_deploy_bundleid()
114
- else
115
- mainapp_bundleid = get_selected_dev_bundleid()
116
- end
117
-
118
- args_temp = []
119
- args_temp << mainapp_bundleid
120
- Pindo::Command::Deploy::Pullconfig::run(args_temp)
121
-
122
- Dir.chdir(project_dir)
123
-
124
- config_json_file = File.join(project_dir,"config.json")
125
- # 处理entitlements配置
126
- Pindo::XcodeBuildConfig.update_entitlements_config(project_dir: project_dir, config_file: config_json_file)
127
-
128
- if File.exist?(File.join(project_dir, "Podfile"))
129
-
130
- args_temp = []
131
- args_temp << config_json_file
132
- Pindo::Command::Lib::Update::run([])
133
-
134
- begin
135
- if File.exist?(File.join(project_dir, "Podfile.lock"))
136
- FileUtils.rm_rf(File.join(project_dir, "Podfile.lock"))
137
- end
138
- if File.exist?(File.join(project_dir,"Pods"))
139
- FileUtils.rm_rf(File.join(project_dir, "Pods"))
140
- end
141
- puts "正在执行pod deintegrate..."
142
- system 'pod deintegrate'
143
- puts "正在执行pod install..."
144
- system 'pod install'
145
- rescue => error
146
- puts(error.to_s)
147
- raise Informative, "pod install失败!!先pod install 完成后成编译 !"
148
- end
149
-
150
- Dir.chdir(project_dir)
151
- pod_lock_file = File.join(project_dir, "Podfile.lock")
152
- if !File.exist?(pod_lock_file)
153
- raise Informative, "pod install失败!!先pod install 完成后成编译 !"
154
- end
155
-
156
- end
157
-
158
-
159
- args_temp = []
160
- if @args_adhoc_flag
161
- args_temp << "--adhoc"
162
- else
163
- args_temp << "--dev"
164
- end
165
-
166
- project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
167
- if !project_fullname.nil?
168
- project_obj = Xcodeproj::Project.open(project_fullname)
169
- project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
170
- if !project_build_platform.nil? && project_build_platform.eql?("macosx")
171
- @args_macos_flag = true
172
- end
173
- end
174
-
175
- if @args_macos_flag
176
- args_temp << "--macos"
177
- end
178
-
179
- Pindo::Command::Deploy::Cert::run(args_temp)
180
-
181
- # 根据证书配置后的实际 Bundle ID 重新更新 URL Schemes
182
- # 因为 Cert::run 可能会修改 PRODUCT_BUNDLE_IDENTIFIER
183
- if @args_upload_flag && workflow_info && workflow_info[:package_name]
184
- Pindo::XcodeBuildConfig.update_url_schemes_with_bundleid(
185
- project_dir: project_dir,
186
- package_name: workflow_info[:package_name]
187
- )
188
- end
189
-
190
- Dir.chdir(project_dir)
191
- Pindo::Command::Deploy::Build::run(args_temp)
192
-
193
-
194
- pindo_new_project_dir = Dir.pwd
195
- build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
196
- ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
197
-
198
- if !ipa_file_upload.nil? && !app_info_obj.nil?
199
- description = nil
200
- if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
201
- description = File.read(File.join(pindo_new_project_dir, ".release_info"))
202
- else
203
- if File.exist?(File.join(pindo_new_project_dir, ".git"))
204
- description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
205
- end
206
- end
207
- result_data = PgyerHelper.share_instace.start_upload(
208
- app_info_obj: app_info_obj,
209
- ipa_file_upload: ipa_file_upload,
210
- description: description,
211
- workflow_info: workflow_info
212
- )
213
- if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
214
- PgyerHelper.share_instace.print_app_version_info(
215
- app_info_obj: app_info_obj,
216
- app_version_info_obj: result_data["data"]
217
- )
218
- if @args_send_flag
219
- # 始终发送给自己
220
- PgyerHelper.share_instace.send_apptest_msg(
221
- app_info_obj: app_info_obj,
222
- app_version_info_obj: result_data["data"],
223
- receiveType: "self"
224
- )
225
-
226
- # 额外发送到测试群
227
- PgyerHelper.share_instace.send_apptest_msg(
228
- app_info_obj: app_info_obj,
229
- app_version_info_obj: result_data["data"],
230
- chatEnv: "DevTest",
231
- receiveType: "chat"
232
- )
233
- end
234
- end
235
- end
236
-
237
- system "open #{project_dir}"
238
-
239
- end
240
-
241
- end
242
- end
243
- end
244
- end
245
-
@@ -1,16 +0,0 @@
1
-
2
-
3
- require 'pindo/command/ipa/import'
4
- require 'pindo/command/ipa/output'
5
- require 'pindo/command/ipa/autoresign'
6
-
7
- module Pindo
8
- class Command
9
-
10
- class Ipa < Command
11
- self.abstract_command = true
12
- self.summary = '发布阶段自动化相关命令'
13
- end
14
-
15
- end
16
- end