pindo 4.8.7 → 4.8.8

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: 24b5673e6e6b22077a55006939dc549e2b545537d935c6a004bed385dd936014
4
- data.tar.gz: 699659aa13cff6c29fd5cbf63ba1a16707cb1ba6e8811f913094c968d4fcd09a
3
+ metadata.gz: '05280c1e438cd48e755e5a943dcb80296ebacec092a3cdd92997141206eeb49e'
4
+ data.tar.gz: e3c127d77c032834b54dfee874f9c79499b217afa67e61c99b96bca34d355384
5
5
  SHA512:
6
- metadata.gz: 1ae0851cb8497f852602e3fe26c49f6a1e69e0ba922c44833cf43abe12c186b6d1fec343ac29c3d62c1299c841dda8b0a0782caec8c952885a2fb9c1b0bd4805
7
- data.tar.gz: 7ba1a294c60d4d1633e0f136a04d24712f7b01aec7c0702e890b8d7325e0261497897a67fbe55e1a9f63faaec566e70e8f98d52081c75c134bfbd3bd6953077a
6
+ metadata.gz: 9184262c10bbd7aeec778658d9b267d1fa613dc5065e55bd0f5d3313dbff55dc19e08cb40218eaad9b3a45b4bb583686e67daf810f7f797ccc24b9fa48a5f07d
7
+ data.tar.gz: fd7d0b9a6ff225f2ff1f9bcac2557ba1146a1f96e8c6478af12198f3bdcb43b3ac3cce7d512b6a66ce6553e7045247607ad24d04fd459cf759b0c44a5920a9fc
@@ -180,7 +180,7 @@ module Pindo
180
180
  else
181
181
  Funlog.instance.fancyinfo_error("pgyer token文件不存在!")
182
182
  end
183
-
183
+ puts "token: #{@token}"
184
184
  return @token
185
185
  end
186
186
 
@@ -494,5 +494,38 @@ module Pindo
494
494
 
495
495
  end
496
496
 
497
+ def post_message(appId:nil, appVersionId:nil, chatEnv: nil, receiveType:nil)
498
+
499
+ boss_url = @baseurl + @request_config["send_lark_message"]
500
+
501
+ body_params = {
502
+ appId:appId,
503
+ appVersionId:appVersionId,
504
+ chatEnv:chatEnv,
505
+ receiveType:receiveType
506
+ }
507
+
508
+
509
+ con = HttpClient.create_instance_with_proxy
510
+
511
+ res = con.post do |req|
512
+ req.url boss_url
513
+ req.headers['Content-Type'] = 'application/json'
514
+ req.headers['token'] = @token["token"]
515
+ req.body = body_params.to_json
516
+ end
517
+
518
+
519
+ result_date = nil
520
+ if !res.body.nil?
521
+ result_date = JSON.parse(res.body)
522
+ end
523
+
524
+ puts JSON.pretty_generate(result_date)
525
+
526
+ return result_date
527
+
528
+ end
529
+
497
530
  end
498
531
  end
@@ -0,0 +1,73 @@
1
+ require 'fileutils'
2
+
3
+ module Pindo
4
+ class Command
5
+ class Android < Command
6
+ class Debug < Android
7
+
8
+ # Android Debug包编译和上传命令
9
+ self.summary = '编译Android Debug包并支持上传到测试平台'
10
+
11
+ # 详细说明
12
+ self.description = <<-DESC
13
+ 编译Android Debug包并支持上传到测试平台。
14
+
15
+ 支持功能:
16
+
17
+ * 编译Debug包
18
+
19
+ * 上传到测试平台
20
+
21
+ * 发送测试通知
22
+
23
+ 使用示例:
24
+
25
+ $ pindo android debug # 编译Debug包
26
+
27
+ $ pindo android debug --upload # 编译并上传
28
+
29
+ $ pindo android debug --send # 编译上传并发送通知
30
+
31
+ $ pindo android debug --proj=myapp # 指定项目名称
32
+
33
+ DESC
34
+
35
+ # 命令参数
36
+ self.arguments = [
37
+ # 暂无参数
38
+ ]
39
+
40
+ # 命令选项
41
+ def self.options
42
+ [
43
+ ['--proj', '指定上传到测试平台的项目名称'],
44
+ ['--upload', '上传编译后的apk到测试平台'],
45
+ ['--send', '上传成功后发送测试通知']
46
+ ].concat(super)
47
+ end
48
+
49
+ def initialize(argv)
50
+ @args_adhoc_flag = argv.flag?('adhoc', false)
51
+ @args_deploy_flag = argv.flag?('deploy', false)
52
+ @args_macos_flag = argv.flag?('macos', false)
53
+ @upload_flag = argv.flag?('upload', false)
54
+ @send_flag = argv.flag?('send', false)
55
+ @proj_name = argv.option('proj')
56
+
57
+ if @send_flag
58
+ @upload_flag = true
59
+ end
60
+
61
+ super
62
+ end
63
+
64
+ def run
65
+ # TODO: 实现编译和上传逻辑
66
+ puts "Android Debug包编译和上传命令"
67
+
68
+ end
69
+
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,14 @@
1
+
2
+
3
+ require 'pindo/command/android/debug'
4
+
5
+ module Pindo
6
+ class Command
7
+
8
+ class Android < Command
9
+ self.abstract_command = true
10
+ self.summary = 'Android相关命令'
11
+ end
12
+
13
+ end
14
+ end
@@ -69,6 +69,8 @@ module Pindo
69
69
 
70
70
  args_temp = []
71
71
  args_temp << mainapp_bundleid
72
+
73
+
72
74
  Pindo::Command::Deploy::Pullconfig::run(args_temp)
73
75
 
74
76
  project_dir = Dir.pwd
@@ -53,12 +53,13 @@ module Pindo
53
53
  app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
54
54
  end
55
55
 
56
+
56
57
  args_temp = []
57
58
  Pindo::Command::Deploy::Build::run(args_temp)
58
59
 
59
60
 
60
61
  pindo_new_project_dir = Dir.pwd
61
- build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
62
+ build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app,apk}")
62
63
  ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
63
64
 
64
65
  if !ipa_file_upload.nil? && !app_info_obj.nil?
@@ -74,9 +75,11 @@ module Pindo
74
75
  end
75
76
  end
76
77
  end
78
+
77
79
  result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
78
80
  if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
79
81
  msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
82
+
80
83
  PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
81
84
  if @args_send_flag
82
85
  PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
@@ -12,22 +12,38 @@ module Pindo
12
12
  self.summary = '更新证书并使用新证书设置工程'
13
13
 
14
14
  self.description = <<-DESC
15
+ 更新证书并使用新证书设置工程。
15
16
 
16
- 更新证书并使用新证书设置工程,如果在工程目录下执行,会自动给工程设置对应的证书。用法:pindo dev debug 默认使用开发bundle id, 使用dev证书。
17
- 使用发布相关bundle id 或者adhoc证书,用法如下:pindo dev debug --deploy --adhoc
18
-
17
+ 支持功能:
18
+
19
+ * 自动更新证书
20
+
21
+ * 自动设置工程证书
22
+
23
+ * 支持开发和发布证书
24
+
25
+ * 支持iOS和macOS平台
26
+
27
+ 使用示例:
28
+
29
+ $ pindo dev debug # 使用开发证书
30
+
31
+ $ pindo dev debug --deploy # 使用发布bundle id
32
+
33
+ $ pindo dev debug --adhoc # 使用adhoc证书
34
+
35
+ $ pindo dev debug --macos # 使用macOS证书
19
36
  DESC
20
37
 
21
38
  self.arguments = [
22
-
39
+ # 暂无参数
23
40
  ]
24
41
 
25
42
  def self.options
26
43
  [
27
- ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id'],
28
- ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书'],
29
- ['--macos', 'macos平台证书'],
30
- ['--upload', '生成上传pgyer的证书'],
44
+ ['--deploy', '使用发布bundle id(默认使用开发bundle id)'],
45
+ ['--adhoc', '使用adhoc证书(默认使用dev证书)'],
46
+ ['--macos', '使用macOS平台证书'],
31
47
  ].concat(super)
32
48
  end
33
49
 
@@ -35,7 +51,6 @@ module Pindo
35
51
  @args_adhoc_flag = argv.flag?('adhoc', false)
36
52
  @args_deploy_flag = argv.flag?('deploy', false)
37
53
  @args_macos_flag = argv.flag?('macos', false)
38
- @upload_flag = argv.flag?('upload', false)
39
54
  super
40
55
  end
41
56
 
@@ -80,10 +95,6 @@ module Pindo
80
95
  if @args_macos_flag
81
96
  args_temp << "--macos"
82
97
  end
83
-
84
- if @upload_flag
85
- args_temp << "--upload"
86
- end
87
98
 
88
99
  Pindo::Command::Deploy::Cert::run(args_temp)
89
100
 
@@ -145,5 +156,4 @@ module Pindo
145
156
  end
146
157
  end
147
158
  end
148
- end
149
-
159
+ end
@@ -0,0 +1,43 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+
6
+ module Pindo
7
+ class Command
8
+ class Appstore < Command
9
+ class Iap < Appstore
10
+
11
+
12
+ self.summary = 'Appstore中iap相关操作'
13
+
14
+ self.description = <<-DESC
15
+ Appstore中iap相关操作,配置目录下执行:pindo appstore iap, 默认创建iap购买项
16
+ DESC
17
+
18
+ self.arguments = [
19
+ CLAide::Argument.new('path/to/config.json', false),
20
+ ]
21
+
22
+ def self.options
23
+ [
24
+ ['--download', '下载app的所有购买项,用法:pindo appstore iap --download'],
25
+ ].concat(super)
26
+ end
27
+
28
+ def initialize(argv)
29
+
30
+ @args_download_name = argv.option('download')
31
+
32
+ super
33
+ end
34
+
35
+
36
+ def run
37
+
38
+ end
39
+
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,41 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+
6
+ module Pindo
7
+ class Command
8
+ class Appstore < Command
9
+ class Itcapp < Appstore
10
+
11
+
12
+ self.summary = 'Appstore中创建app'
13
+
14
+ self.description = <<-DESC
15
+ Appstore中创建app,配置目录下执行:pindo appstore itcapp
16
+ DESC
17
+
18
+ self.arguments = [
19
+ CLAide::Argument.new('path/to/config.json', false),
20
+ ]
21
+
22
+ def self.options
23
+ [
24
+
25
+ ].concat(super)
26
+ end
27
+
28
+ def initialize(argv)
29
+
30
+ super
31
+ end
32
+
33
+
34
+ def run
35
+
36
+ end
37
+
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,43 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+
6
+ module Pindo
7
+ class Command
8
+ class Appstore < Command
9
+ class Metadata < Appstore
10
+
11
+
12
+ self.summary = 'Appstore中metadata相关操作'
13
+
14
+ self.description = <<-DESC
15
+ Appstore中metadata相关操作, 用法:pindo appstre metadata
16
+ DESC
17
+
18
+ self.arguments = [
19
+ CLAide::Argument.new('path/to/config.json', false),
20
+ ]
21
+
22
+ def self.options
23
+ [
24
+ ['--download', '下载app的所有购买项,用法:pindo appstore metadata --download'],
25
+ ].concat(super)
26
+ end
27
+
28
+ def initialize(argv)
29
+
30
+ @args_download_name = argv.option('download')
31
+
32
+ super
33
+ end
34
+
35
+
36
+ def run
37
+
38
+ end
39
+
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+
6
+ module Pindo
7
+ class Command
8
+ class Appstore < Command
9
+ class Screenshots < Appstore
10
+
11
+
12
+ self.summary = 'Appstore中screenshots相关操作'
13
+
14
+ self.description = <<-DESC
15
+ Appstore中screenshots相关操作, 用法:pindo appstre screenshots
16
+ DESC
17
+
18
+ self.arguments = [
19
+ CLAide::Argument.new('path/to/config.json', false),
20
+ ]
21
+
22
+ def self.options
23
+ [
24
+ ['--download', '下载app的所有购买项,用法:pindo appstore screenshots --download'],
25
+ ].concat(super)
26
+ end
27
+
28
+ def initialize(argv)
29
+
30
+ @args_download_name = argv.option('download')
31
+
32
+ super
33
+ end
34
+
35
+
36
+ def run
37
+
38
+ end
39
+
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,40 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+
6
+ module Pindo
7
+ class Command
8
+ class Appstore < Command
9
+ class Upload < Appstore
10
+
11
+ self.summary = '上传ipa到appstore'
12
+
13
+ self.description = <<-DESC
14
+ 上传ipa到appstore:pindo appstore upload
15
+ DESC
16
+
17
+ self.arguments = [
18
+ CLAide::Argument.new('path/to/config.json', false),
19
+ ]
20
+
21
+ def self.options
22
+ [
23
+
24
+
25
+ ].concat(super)
26
+ end
27
+
28
+ def initialize(argv)
29
+
30
+ super
31
+ end
32
+
33
+ def run
34
+
35
+ end
36
+
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+
2
+ require 'pindo/command/appstore/iap'
3
+ require 'pindo/command/appstore/itcapp'
4
+ require 'pindo/command/appstore/metadata'
5
+ require 'pindo/command/appstore/screenshots'
6
+ require 'pindo/command/appstore/upload'
7
+
8
+ module Pindo
9
+ class Command
10
+
11
+ class Appstore < Command
12
+ self.abstract_command = true
13
+ self.summary = 'appstore的相关命令'
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,190 @@
1
+ require 'highline/import'
2
+ require 'xcodeproj'
3
+ require 'find'
4
+ require 'fileutils'
5
+ require 'pindo/base/executable'
6
+
7
+ module Pindo
8
+ class Command
9
+ class Ios < Command
10
+ class Adhoc < Ios
11
+
12
+ include Appselect
13
+
14
+ # 命令的简要说明 - 设置开发环境并编译iOS工程
15
+ self.summary = '设置开发环境并编译iOS工程'
16
+
17
+ # 命令的详细说明,包含用法示例
18
+ self.description = <<-DESC
19
+ 设置开发环境并编译iOS工程。
20
+
21
+ 支持功能:
22
+
23
+ * 自动设置开发环境
24
+
25
+ * 编译打包上传
26
+
27
+ * 发送测试通知
28
+
29
+ 使用示例:
30
+
31
+ $ pindo ios adhoc # 设置开发环境
32
+
33
+ $ pindo ios adhoc --upload # 编译并上传
34
+
35
+ $ pindo ios adhoc --send # 编译并上传并发送通知
36
+
37
+ $ pindo ios adhoc --proj=myapp # 指定项目名称
38
+ DESC
39
+
40
+ # 命令的参数列表
41
+ self.arguments = [
42
+
43
+ ]
44
+
45
+ # 命令的选项列表
46
+ def self.options
47
+ [
48
+ # 指定上传到蒲公英的项目
49
+ ['--proj', '指定上传到测试平台的项目名称'],
50
+ # 上传编译包
51
+ ['--upload', '上传编译后的ipa到测试平台'],
52
+ # 发送通知
53
+ ['--send', '上传成功后发送测试通知']
54
+ ].concat(super)
55
+ end
56
+
57
+ def initialize(argv)
58
+
59
+ @args_deploy_flag = argv.flag?('deploy', false)
60
+ @args_adhoc_flag = argv.flag?('adhoc', false)
61
+ @args_upload_flag = argv.flag?('upload', false)
62
+ @args_send_flag = argv.flag?('send', false)
63
+ @args_proj_name = argv.option('proj')
64
+
65
+ if @args_send_flag
66
+ @args_upload_flag = true
67
+ end
68
+
69
+ super
70
+ @additional_args = argv.remainder!
71
+ end
72
+
73
+ def validate!
74
+
75
+ super
76
+ end
77
+
78
+ def run
79
+
80
+ mainapp_bundleid= nil
81
+ if @args_deploy_flag
82
+ mainapp_bundleid = get_selected_deploy_bundleid()
83
+ else
84
+ mainapp_bundleid = get_selected_dev_bundleid()
85
+ end
86
+
87
+ app_info_obj = nil
88
+ if @args_upload_flag
89
+ proj_name = @args_proj_name
90
+ app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
91
+ end
92
+
93
+ args_temp = []
94
+ args_temp << mainapp_bundleid
95
+ Pindo::Command::Deploy::Pullconfig::run(args_temp)
96
+
97
+ project_dir = Dir.pwd
98
+ Dir.chdir(project_dir)
99
+ config_json_file = File.join(project_dir,"config.json")
100
+ Cert::modify_cert_with_project(project_dir:project_dir, config_file:config_json_file)
101
+
102
+ if File.exist?(File.join(project_dir, "Podfile"))
103
+
104
+ args_temp = []
105
+ args_temp << config_json_file
106
+ Pindo::Command::Lib::Update::run([])
107
+
108
+ begin
109
+ if File.exist?(File.join(project_dir, "Podfile.lock"))
110
+ FileUtils.rm_rf(File.join(project_dir, "Podfile.lock"))
111
+ end
112
+ if File.exist?(File.join(project_dir,"Pods"))
113
+ FileUtils.rm_rf(File.join(project_dir, "Pods"))
114
+ end
115
+ puts "正在执行pod deintegrate..."
116
+ system 'pod deintegrate'
117
+ puts "正在执行pod install..."
118
+ system 'pod install'
119
+ rescue => error
120
+ puts(error.to_s)
121
+ raise Informative, "pod install失败!!先pod install 完成后成编译 !"
122
+ end
123
+
124
+ Dir.chdir(project_dir)
125
+ pod_lock_file = File.join(project_dir, "Podfile.lock")
126
+ if !File.exist?(pod_lock_file)
127
+ raise Informative, "pod install失败!!先pod install 完成后成编译 !"
128
+ end
129
+
130
+ end
131
+
132
+
133
+ args_temp = []
134
+ if @args_adhoc_flag
135
+ args_temp << "--adhoc"
136
+ else
137
+ args_temp << "--dev"
138
+ end
139
+
140
+ project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
141
+ if !project_fullname.nil?
142
+ project_obj = Xcodeproj::Project.open(project_fullname)
143
+ project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
144
+ if !project_build_platform.nil? && project_build_platform.eql?("macosx")
145
+ @args_macos_flag = true
146
+ end
147
+ end
148
+
149
+ if @args_macos_flag
150
+ args_temp << "--macos"
151
+ end
152
+
153
+ Pindo::Command::Deploy::Cert::run(args_temp)
154
+
155
+ Dir.chdir(project_dir)
156
+ Pindo::Command::Deploy::Build::run(args_temp)
157
+
158
+
159
+ pindo_new_project_dir = Dir.pwd
160
+ build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
161
+ ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
162
+
163
+ if !ipa_file_upload.nil? && !app_info_obj.nil?
164
+ description = nil
165
+ if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
166
+ description = File.read(File.join(pindo_new_project_dir, ".release_info"))
167
+ else
168
+ if File.exist?(File.join(pindo_new_project_dir, ".git"))
169
+ description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
170
+ end
171
+ end
172
+ result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
173
+ if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
174
+ msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
175
+ PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
176
+ if @args_send_flag
177
+ PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
178
+ end
179
+ end
180
+ end
181
+
182
+ system "open #{project_dir}"
183
+
184
+ end
185
+
186
+ end
187
+ end
188
+ end
189
+ end
190
+