pindo 4.7.0 → 4.7.2

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pindo/base/aeshelper.rb +30 -2
  3. data/lib/pindo/base/githelper.rb +7 -9
  4. data/lib/pindo/client/aws3sclient.rb +1 -1
  5. data/lib/pindo/client/bossconfigclient.rb +3 -3
  6. data/lib/pindo/client/giteeclient.rb +2 -2
  7. data/lib/pindo/client/pgyerclient.rb +97 -102
  8. data/lib/pindo/command/appstore/iap.rb +1 -1
  9. data/lib/pindo/command/deploy/build.rb +70 -4
  10. data/lib/pindo/command/deploy/cert.rb +68 -67
  11. data/lib/pindo/command/{utils → dev}/applovin.rb +2 -2
  12. data/lib/pindo/command/dev/autobuild.rb +19 -7
  13. data/lib/pindo/command/dev/autoresign.rb +10 -6
  14. data/lib/pindo/command/dev/build.rb +94 -0
  15. data/lib/pindo/command/dev.rb +3 -6
  16. data/lib/pindo/command/ipa/autoresign.rb +4 -1
  17. data/lib/pindo/command/ipa/import.rb +45 -9
  18. data/lib/pindo/command/ipa/output.rb +7 -2
  19. data/lib/pindo/command/lib/update.rb +8 -8
  20. data/lib/pindo/command/pgyer/resign.rb +21 -19
  21. data/lib/pindo/command/pgyer/upload.rb +34 -6
  22. data/lib/pindo/command/utils/renewcert.rb +158 -0
  23. data/lib/pindo/command/utils.rb +1 -1
  24. data/lib/pindo/config/pindoconfig.rb +27 -0
  25. data/lib/pindo/module/appselect.rb +9 -8
  26. data/lib/pindo/module/cert/certhelper.rb +42 -36
  27. data/lib/pindo/module/cert/keychainhelper.rb +25 -13
  28. data/lib/pindo/module/cert/provisioninghelper.rb +1 -1
  29. data/lib/pindo/module/cert/xcodecerthelper.rb +98 -39
  30. data/lib/pindo/module/pgyer/pgyerhelper.rb +50 -28
  31. data/lib/pindo/module/xcode/xcodeappconfig.rb +2 -3
  32. data/lib/pindo/module/xcode/xcodereshandler.rb +41 -13
  33. data/lib/pindo/module/xcode/xcodereshelper.rb +2 -3
  34. data/lib/pindo/options/deployoptions.rb +1 -2
  35. data/lib/pindo/version.rb +1 -1
  36. metadata +5 -4
  37. data/lib/pindo/command/dev/renewcert.rb +0 -142
@@ -17,16 +17,54 @@ module Pindo
17
17
  DESC
18
18
 
19
19
  self.arguments = [
20
- CLAide::Argument.new('path/to/config.json', true),
21
20
  ]
22
21
 
22
+
23
+ def self.options
24
+ [
25
+ ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo deploy build --proj=aichatv4'],
26
+ ['--upload', '是否上传编译后的ipa, 用法:pindo deploy build --upload'],
27
+ ['--send', '上传到之后是否发送测试信息,用法:pindo deploy build --send'],
28
+ ['--resign', '上传到之后是否重签名,用法:pindo deploy build --resign'],
29
+ ['--certid', '设置重签名的正式id,用法:pindo deploy build --certid=com.test.bundleid'],
30
+
31
+
32
+ ].concat(super)
33
+ end
34
+
23
35
  def initialize(argv)
24
- super
25
- @additional_args = argv.remainder!
36
+
37
+ @args_upload_flag = argv.flag?('upload', false)
38
+ @args_send_flag = argv.flag?('send', false)
39
+ @args_resign_flag = argv.flag?('resign', false)
40
+
41
+ @args_proj_name = argv.option('proj')
42
+ @args_cert_id = argv.option('certid')
43
+
44
+ if !@args_cert_id.nil? && !@args_cert_id.empty?
45
+ @args_resign_flag = true
46
+ end
47
+ if @args_resign_flag
48
+ @args_send_flag = true
49
+ end
50
+
51
+ if @args_send_flag
52
+ @args_upload_flag = true
53
+ end
54
+
55
+ super
56
+ @additional_args = argv.remainder!
57
+
26
58
  end
27
59
 
28
60
  def run
29
61
 
62
+ app_info_obj = nil
63
+ if @args_upload_flag
64
+ proj_name = @args_proj_name
65
+ app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
66
+ end
67
+
30
68
  new_project_dir = Dir.pwd
31
69
  project_fullname = Dir.glob(File.join(new_project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
32
70
 
@@ -34,13 +72,41 @@ module Pindo
34
72
  FileUtils.rm_rf(File.join(new_project_dir, "build"))
35
73
  end
36
74
 
37
-
38
75
  gym_options = get_gym_build_values(project_fullname:project_fullname)
39
76
 
40
77
  config = FastlaneCore::Configuration.create(Gym::Options.available_options, gym_options)
41
78
  Gym::Manager.new.work(config)
42
79
 
43
80
 
81
+
82
+ pindo_new_project_dir = Dir.pwd
83
+ build_path = File.join(pindo_new_project_dir, "build", "*.ipa")
84
+ ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
85
+
86
+ if !ipa_file_upload.nil? && !app_info_obj.nil?
87
+ description = nil
88
+ result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
89
+ if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
90
+ msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
91
+ PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
92
+ if @args_send_flag
93
+ if @args_resign_flag
94
+ args = []
95
+ args << "--send"
96
+ if !@args_cert_id.nil? && !@args_cert_id.empty?
97
+ args << "--certid=#{@args_cert_id}"
98
+ end
99
+ if !@args_proj_name.nil? && !@args_proj_name.empty?
100
+ args << "--proj=#{@args_proj_name}"
101
+ end
102
+
103
+ Pindo::Command::Pgyer::Resign::run(args)
104
+ else
105
+ PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
106
+ end
107
+ end
108
+ end
109
+ end
44
110
  end
45
111
 
46
112
 
@@ -60,7 +60,7 @@ module Pindo
60
60
  end
61
61
 
62
62
  def run
63
-
63
+
64
64
  if @clean_flag
65
65
  puts "Clear cert at local ..."
66
66
  Pindo::Command::Utils::Clearcert::run([])
@@ -81,99 +81,100 @@ module Pindo
81
81
  bundle_id_array = get_bundle_id_map.values
82
82
  provisioning_info_array = nil
83
83
 
84
- # if @renew_cert_flag || @match_flag
84
+ if @renew_cert_flag || @match_flag
85
85
  values = get_create_cert_match_values(apple_id:@apple_id, bundle_id_array:bundle_id_array, build_type:@build_type, renew_flag:@renew_cert_flag)
86
86
  config = FastlaneCore::Configuration.create(Match::Options.available_options, values)
87
87
  Match::Runner.new.run(config)
88
88
  provisioning_info_array = create_provisioning_info_array(build_type:@build_type)
89
89
  pindo_single_config.set_cert_info(dict: provisioning_info_array)
90
+
91
+ else
92
+ cert_git_url = pindo_single_config.deploy_cert_giturl
93
+ if @apple_id.eql?(pindo_single_config.demo_apple_id)
94
+ cert_git_url = pindo_single_config.dev_cert_giturl
95
+ end
96
+ cert_reponame = cert_git_url.split("/").last.chomp(".git")
97
+ certs_dir = getcode_to_dir(reponame:cert_reponame, remote_url:cert_git_url, path: pindo_single_config.pindo_dir, new_branch:@apple_id)
90
98
 
91
- # else
92
-
93
- # cert_git_url = pindo_single_config.deploy_cert_giturl
94
- # if @apple_id.eql?(pindo_single_config.demo_apple_id)
95
- # cert_git_url = pindo_single_config.dev_cert_giturl
96
- # end
97
- # cert_reponame = cert_git_url.split("/").last.chomp(".git")
98
- # certs_dir = getcode_to_dir(reponame:cert_reponame, remote_url:cert_git_url, path: pindo_single_config.pindo_dir, new_branch:@apple_id)
99
+ install_certs(cert_url:cert_git_url, certs_dir:certs_dir, cert_type:@build_type)
100
+ bundle_id_map = get_bundle_id_map
99
101
 
100
- # install_certs(certs_dir:certs_dir, cert_type:@build_type)
101
- # bundle_id_map = get_bundle_id_map
102
- # provisioning_info_array = install_provisionfiles(certs_dir:certs_dir, bundle_id_map:bundle_id_map, cert_type:@build_type)
103
- # pindo_single_config.set_cert_info(dict: provisioning_info_array)
104
- # end
102
+ provisioning_info_array = install_provisionfiles(cert_url:cert_git_url, certs_dir:certs_dir, bundle_id_map:bundle_id_map, cert_type:@build_type)
103
+ pindo_single_config.set_cert_info(dict: provisioning_info_array)
104
+ end
105
105
 
106
+ provisioning_info_array = provisioning_info_array || []
107
+ unless provisioning_info_array.size > 0
108
+ raise Informative, "未找到证书信息"
109
+ end
106
110
 
107
- team_id_key = Match::Utils.environment_variable_name_team_id(app_identifier: @bundle_id,type:@build_type)
108
- @team_id_vaule = ENV[team_id_key]
111
+ @team_id_vaule = provisioning_info_array.first["team_id"]
109
112
 
110
113
  #发布机需要给swark注册bundle id
111
114
  add_swark_authorize_json
112
115
 
113
- if @args_adhoc_flag || @args_appstore_flag
114
- cert_type = "Development".downcase
115
- if @args_adhoc_flag
116
- cert_type = "Adhoc".downcase
117
- end
118
- if @upload_flag
119
- create_upload_cert_info(apple_id:@apple_id, cert_type:cert_type, provisioning_info_array:provisioning_info_array)
120
- end
121
- end
122
-
123
116
  new_project_dir = Dir.pwd
124
117
  new_project_fullname = Dir.glob(File.join(new_project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
125
118
  if !new_project_fullname.nil? && File.exist?(new_project_fullname) && !provisioning_info_array.nil? && provisioning_info_array.size > 0
126
119
  new_proj_name = File.basename(new_project_fullname, ".xcodeproj")
120
+ Funlog.instance.fancyinfo_start("正在给Xcode配置证书...")
127
121
  config_project_cert(new_proj_name:new_proj_name, new_project_dir:new_project_dir, cert_type:@build_type, team_id_vaule:@team_id_vaule, provisioning_info_array:provisioning_info_array)
128
122
  config_infoplist_cert(new_proj_name:new_proj_name, new_project_dir:new_project_dir, icloud_id:@icloud_id, group_id:@group_id, provisioning_info_array:provisioning_info_array)
123
+ Funlog.instance.fancyinfo_success("Xcode配置证书完成!")
129
124
  end
130
- end
131
- end
132
125
 
133
- def get_create_cert_match_values(apple_id:nil, bundle_id_array:nil, build_type:nil, renew_flag:false)
126
+ if @upload_flag
127
+ create_upload_cert_info(apple_id:@apple_id, cert_type:@build_type)
128
+ create_upload_provisioning_info(apple_id:@apple_id, cert_type:@build_type, provisioning_info_array:provisioning_info_array)
129
+ end
130
+ end
131
+
132
+ def get_create_cert_match_values(apple_id:nil, bundle_id_array:nil, build_type:nil, renew_flag:false)
134
133
 
135
- if build_type.eql?("appstore") && (apple_id.eql?(pindo_single_config.demo_apple_id))
136
- raise Informative, "#{apple_id} 是测试账号,不能创建appstore证书!!!"
137
- end
138
- if !build_type.eql?("appstore") && !apple_id.eql?(pindo_single_config.demo_apple_id)
139
- raise Informative, "账号#{apple_id} 不能创建dev或者adhoc证书!!!"
140
- end
134
+ if build_type.eql?("appstore") && (apple_id.eql?(pindo_single_config.demo_apple_id))
135
+ raise Informative, "#{apple_id} 是测试账号,不能创建appstore证书!!!"
136
+ end
137
+ if !build_type.eql?("appstore") && !apple_id.eql?(pindo_single_config.demo_apple_id)
138
+ raise Informative, "账号#{apple_id} 不能创建dev或者adhoc证书!!!"
139
+ end
141
140
 
142
- git_url = pindo_single_config.deploy_cert_giturl
143
- if @apple_id.eql?(pindo_single_config.demo_apple_id)
144
- git_url = pindo_single_config.dev_cert_giturl
145
- end
141
+ git_url = pindo_single_config.deploy_cert_giturl
142
+ if @apple_id.eql?(pindo_single_config.demo_apple_id)
143
+ git_url = pindo_single_config.dev_cert_giturl
144
+ end
146
145
 
147
- force_for_new_devices_flag = true
148
- if build_type.eql?("appstore")
149
- force_for_new_devices_flag = false
150
- end
146
+ force_for_new_devices_flag = true
147
+ if build_type.eql?("appstore")
148
+ force_for_new_devices_flag = false
149
+ end
151
150
 
152
- platform_type = "ios"
153
- if @config_json && @config_json['project_info'] && @config_json['project_info']['build_type'].include?("MacOS")
154
- platform_type = "macos"
155
- end
151
+ platform_type = "ios"
152
+ if @config_json && @config_json['project_info'] && @config_json['project_info']['build_type'].include?("MacOS")
153
+ platform_type = "macos"
154
+ end
155
+
156
+ values = {
157
+ username:apple_id,
158
+ app_identifier: bundle_id_array,
159
+ type: build_type,
160
+ keychain_password:"goodcert1",
161
+ git_url: git_url,
162
+ readonly:!renew_flag,
163
+ force:renew_flag,
164
+ clone_branch_directly:!renew_flag,
165
+ include_mac_in_profiles:true,
166
+ include_all_certificates:true,
167
+ generate_apple_certs:true,
168
+ shallow_clone:!renew_flag,
169
+ git_branch: apple_id,
170
+ platform:platform_type,
171
+ force_for_new_devices:force_for_new_devices_flag
172
+ }
173
+ return values
156
174
 
157
- values = {
158
- username:apple_id,
159
- app_identifier: bundle_id_array,
160
- type: build_type,
161
- keychain_password:"goodcert1",
162
- git_url: git_url,
163
- readonly:!renew_flag,
164
- force:renew_flag,
165
- clone_branch_directly:!renew_flag,
166
- include_mac_in_profiles:true,
167
- include_all_certificates:true,
168
- generate_apple_certs:true,
169
- shallow_clone:!renew_flag,
170
- git_branch: apple_id,
171
- platform:platform_type,
172
- force_for_new_devices:force_for_new_devices_flag
173
- }
174
- return values
175
- end
175
+ end
176
176
 
177
+ end
177
178
  end
178
179
  end
179
180
  end
@@ -8,8 +8,8 @@ require 'xcodeproj'
8
8
 
9
9
  module Pindo
10
10
  class Command
11
- class Utils < Command
12
- class Applovin < Utils
11
+ class Dev < Command
12
+ class Applovin < Dev
13
13
 
14
14
  self.summary = '接入applovin max广告平台时更新Xcode中info.plist'
15
15
 
@@ -23,11 +23,11 @@ module Pindo
23
23
 
24
24
  def self.options
25
25
  [
26
- ['--deploy', '默认用开发的bundle id,用法:pindo ipa autobuild --deploy'],
27
- ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书编译, 用法:pindo ipa autobuild --adhoc'],
28
- ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo ipa autobuild --proj=aichatv4'],
29
- ['--upload', '是否上传编译后的ipa, 用法:pindo ipa autobuild --upload'],
30
- ['--send', '上传到之后是否发送测试信息,用法:pindo ipa autobuild --send'],
26
+ ['--deploy', '默认用开发的bundle id,用法:pindo dev autobuild --deploy'],
27
+ ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书编译, 用法:pindo dev autobuild --adhoc'],
28
+ ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo dev autobuild --proj=aichatv4'],
29
+ ['--upload', '是否上传编译后的ipa, 用法:pindo dev autobuild --upload'],
30
+ ['--send', '上传到之后是否发送测试信息,用法:pindo dev autobuild --send'],
31
31
  ].concat(super)
32
32
  end
33
33
 
@@ -39,6 +39,10 @@ module Pindo
39
39
  @args_send_flag = argv.flag?('send', false)
40
40
  @args_proj_name = argv.option('proj')
41
41
 
42
+ if @args_send_flag
43
+ @args_upload_flag = true
44
+ end
45
+
42
46
  super
43
47
  @additional_args = argv.remainder!
44
48
  end
@@ -58,7 +62,7 @@ module Pindo
58
62
  end
59
63
 
60
64
  app_info_obj = nil
61
- if @args_upload_flag || @args_send_flag
65
+ if @args_upload_flag
62
66
  proj_name = @args_proj_name
63
67
  app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
64
68
  end
@@ -120,7 +124,15 @@ module Pindo
120
124
  ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
121
125
 
122
126
  if !ipa_file_upload.nil? && !app_info_obj.nil?
123
- result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:nil)
127
+ description = nil
128
+ if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
129
+ description = File.read(File.join(pindo_new_project_dir, ".release_info"))
130
+ else
131
+ if File.exist?(File.join(pindo_new_project_dir, ".git"))
132
+ description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
133
+ end
134
+ end
135
+ result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
124
136
  if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
125
137
  msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
126
138
  PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
@@ -24,12 +24,12 @@ module Pindo
24
24
 
25
25
  def self.options
26
26
  [
27
- ['--ipa', '指定ipa的路径,用法:pindo ipa autoresign --ipa=path/to/name.ipa'],
28
- ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书编译, 用法:pindo ipa autoresign --adhoc'],
29
- ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id来重签名, 用法:pindo ipa autoresign --deploy'],
30
- ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo ipa autoresign --proj=aichatv4'],
31
- ['--upload', '是否上传编译后的ipa, 用法:pindo ipa autoresign --upload'],
32
- ['--send', '上传到之后是否发送测试信息,用法:pindo ipa autobuild --send'],
27
+ ['--ipa', '指定ipa的路径,用法:pindo dev autoresign --ipa=path/to/name.ipa'],
28
+ ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书编译, 用法:pindo dev autoresign --adhoc'],
29
+ ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id来重签名, 用法:pindo dev autoresign --deploy'],
30
+ ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo dev autoresign --proj=aichatv4'],
31
+ ['--upload', '是否上传编译后的ipa, 用法:pindo dev autoresign --upload'],
32
+ ['--send', '上传到之后是否发送测试信息,用法:pindo dev autoresign --send'],
33
33
  ].concat(super)
34
34
  end
35
35
 
@@ -45,6 +45,10 @@ module Pindo
45
45
  @args_send_flag = argv.flag?('send', false)
46
46
  @args_proj_name = argv.option('proj')
47
47
 
48
+ if @args_send_flag
49
+ @args_upload_flag = true
50
+ end
51
+
48
52
  super
49
53
  @additional_args = argv.remainder!
50
54
  end
@@ -0,0 +1,94 @@
1
+ require 'highline/import'
2
+ require 'fileutils'
3
+ require 'json'
4
+ require 'xcodeproj'
5
+ require 'gym'
6
+
7
+ module Pindo
8
+ class Command
9
+ class Dev < Command
10
+ class Build < Dev
11
+
12
+
13
+ self.summary = '编译工程,并支持上传ipa到测试网站'
14
+
15
+ self.description = <<-DESC
16
+ 编译工程. 用法:在工程目录下执行 pindo dev build --upload
17
+ DESC
18
+
19
+ self.arguments = [
20
+
21
+ ]
22
+
23
+
24
+ def self.options
25
+ [
26
+ ['--proj', '指定上传到pgyer对应的项目名称(大小写空格忽略),用法:pindo dev build --proj=aichatv4'],
27
+ ['--upload', '是否上传编译后的ipa, 用法:pindo dev build --upload'],
28
+ ['--send', '上传到之后是否发送测试信息,用法:pindo dev build --send'],
29
+ ].concat(super)
30
+ end
31
+
32
+ def initialize(argv)
33
+
34
+ @args_upload_flag = argv.flag?('upload', false)
35
+ @args_send_flag = argv.flag?('send', false)
36
+ @args_proj_name = argv.option('proj')
37
+
38
+ if @args_send_flag
39
+ @args_upload_flag = true
40
+ end
41
+
42
+
43
+ super
44
+ @additional_args = argv.remainder!
45
+ end
46
+
47
+ def run
48
+
49
+
50
+ app_info_obj = nil
51
+ if @args_upload_flag
52
+ proj_name = @args_proj_name
53
+ app_info_obj = PgyerHelper.share_instace.prepare_upload(working_directory:Dir.pwd, proj_name:proj_name)
54
+ end
55
+
56
+ args_temp = []
57
+ Pindo::Command::Deploy::Build::run(args_temp)
58
+
59
+
60
+ pindo_new_project_dir = Dir.pwd
61
+ build_path = File.join(pindo_new_project_dir, "build", "*.ipa")
62
+ ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
63
+
64
+ if !ipa_file_upload.nil? && !app_info_obj.nil?
65
+
66
+ description = nil
67
+ if File.exist?(File.join(pindo_new_project_dir, ".release_info"))
68
+ description = File.read(File.join(pindo_new_project_dir, ".release_info"))
69
+ else
70
+ if File.exist?(File.join(pindo_new_project_dir, ".git"))
71
+ description = git!(%W(-C #{pindo_new_project_dir} show -s --format=%h::%s)).strip
72
+ unless !description.nil? && description.length > 10
73
+ description = nil
74
+ end
75
+ end
76
+ end
77
+ result_data = PgyerHelper.share_instace.start_upload(app_info_obj:app_info_obj, ipa_file_upload:ipa_file_upload, description:description)
78
+ if !result_data.nil? && !result_data["data"].nil? && !result_data["data"]["id"].nil?
79
+ msg_data = PgyerHelper.share_instace.make_msg_data(app_info_obj:app_info_obj, app_version_info_obj:result_data["data"])
80
+ PgyerHelper.share_instace.print_app_version_info(msg_data:msg_data)
81
+ if @args_send_flag
82
+ PgyerHelper.share_instace.send_apptest_wechat_msg(msg_data:msg_data)
83
+ end
84
+ end
85
+ end
86
+
87
+
88
+ end
89
+
90
+
91
+ end
92
+ end
93
+ end
94
+ end
@@ -1,16 +1,13 @@
1
1
  # require 'pindo/command/dev/create'
2
2
 
3
3
 
4
- # require 'pindo/command/dev/confuseproj'
5
- # require 'pindo/command/dev/confusecode'
6
- # require 'pindo/command/dev/cert'
7
4
  require 'pindo/command/dev/pub'
8
5
  require 'pindo/command/dev/debug'
9
6
  require 'pindo/command/dev/autoresign'
10
7
  require 'pindo/command/dev/autobuild'
11
- # require 'pindo/command/dev/renewcert'
12
- # require 'pindo/command/dev/pgyercert'
13
- # require 'pindo/command/dev/createbuild'
8
+ require 'pindo/command/dev/build'
9
+ require 'pindo/command/dev/applovin'
10
+
14
11
 
15
12
  module Pindo
16
13
  class Command
@@ -23,7 +23,6 @@ module Pindo
23
23
 
24
24
  def self.options
25
25
  [
26
-
27
26
  ['--ipa', 'iap file name.'],
28
27
  ['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
29
28
  ['--upload', '编译完成后是否上传ipa到pyger: --upload'],
@@ -46,6 +45,10 @@ module Pindo
46
45
  @args_send_flag = argv.flag?('send', false)
47
46
  @args_proj_name = argv.option('proj')
48
47
 
48
+ if @args_send_flag
49
+ @args_upload_flag = true
50
+ end
51
+
49
52
  super
50
53
  @additional_args = argv.remainder!
51
54
  end
@@ -13,9 +13,9 @@ module Pindo
13
13
  class Import < Ipa
14
14
 
15
15
  include Command::DeployOptions
16
-
17
16
  include Pindo::XcodeAppConfig
18
17
  include XcodeBuildHelper
18
+ include Appselect
19
19
 
20
20
  self.summary = '提交时设置Xcode工程编译参数'
21
21
 
@@ -29,10 +29,13 @@ module Pindo
29
29
 
30
30
  def self.options
31
31
  [
32
- ['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
33
- ['--upload', '编译完成后是否上传ipa到pyger: 用法:pindo ipa import --upload'],
34
32
  ['--build', '修改完工程之后直接编译,用法:pindo ipa import --build'],
35
33
  ['--increase', '自动增加编译的app版本号,用法:pindo ipa import --increase'],
34
+ ['--proj', '指定哪个项目(忽略大小写空格等等字符): --proj=\"prancksoundv4\"'],
35
+ ['--upload', '编译完成后是否上传ipa到pyger: 用法:pindo ipa import --upload'],
36
+ ['--send', '上传到之后是否发送测试信息,用法:pindo ipa import --send'],
37
+ ['--resign', '上传到之后是否发送测试信息,用法:pindo ipa import --resign'],
38
+
36
39
 
37
40
  ].concat(super)
38
41
  end
@@ -41,6 +44,20 @@ module Pindo
41
44
  @build_flag = argv.flag?('build', false)
42
45
  @args_increase_flag = argv.flag?('increase', false)
43
46
 
47
+ @args_upload_flag = argv.flag?('upload', false)
48
+ @args_send_flag = argv.flag?('send', false)
49
+ @args_resign_flag = argv.flag?('resign', false)
50
+ @args_proj_name = argv.option('proj')
51
+
52
+ if @args_resign_flag
53
+ @args_send_flag = true
54
+ end
55
+
56
+ if @args_send_flag
57
+ @args_upload_flag = true
58
+ @build_flag = true
59
+ end
60
+
44
61
  super
45
62
  end
46
63
 
@@ -91,9 +108,9 @@ module Pindo
91
108
  pindo_new_project_dir = Dir.pwd
92
109
 
93
110
  if @args_increase_flag
94
- auto_increase_buildnumber(File.join(pindo_new_project_dir, "config.json"))
111
+ auto_increase_buildnumber(app_config_file:File.join(pindo_new_project_dir, "config.json"))
95
112
  app_config_repo_dir = File.join(pindo_single_config.pindo_dir, @deploy_identifier)
96
- auto_increase_buildnumber(File.join(app_config_repo_dir, "config.json"))
113
+ auto_increase_buildnumber(app_config_file:File.join(app_config_repo_dir, "config.json"))
97
114
  git_addpush_repo(path:app_config_repo_dir, message:"increate build number", commit_file_params:["config.json"])
98
115
  end
99
116
 
@@ -175,23 +192,42 @@ module Pindo
175
192
  end
176
193
  end
177
194
 
178
- if pods_array.include?("FancyAD")
195
+ if pods_array.include?("FancyAD") || pods_array.include?("AppLovinSDK")
179
196
  puts
180
197
  puts "Run Applovin Script ..."
181
198
  Dir.chdir(pindo_new_project_dir)
182
199
  applovin_args = []
183
200
  applovin_args << "--appstore"
184
201
  applovin_args << "--install"
185
- Pindo::Command::Utils::Applovin::run(applovin_args)
202
+ Pindo::Command::Dev::Applovin::run(applovin_args)
186
203
  end
187
204
 
188
-
189
205
  if @build_flag
190
206
  Dir.chdir(pindo_new_project_dir)
207
+ if @args_upload_flag
208
+ args_temp << "--upload"
209
+ args_temp << "--proj=#{@args_proj_name}"
210
+ end
211
+ if @args_send_flag
212
+ args_temp << "--send"
213
+ end
214
+
215
+ if @args_resign_flag
216
+ args_temp << "--resign"
217
+ if @config_json && @config_json['project_info'] && @config_json['project_info']['app_type']
218
+ output_repo_name = get_deploy_repo_with_modul_name(module_name:@config_json['project_info']['app_type'])
219
+ if output_repo_name.nil? || output_repo_name == ""
220
+ raise Informative, "config.json app_type is error!!!"
221
+ end
222
+ output_config_dir = clong_buildconfig_repo(repo_name: output_repo_name)
223
+ args_bundle_id = get_setting_bundleid_withdir(repo_dir:output_config_dir)
224
+ args_temp << "--certid=#{args_bundle_id}"
225
+ end
226
+ end
227
+
191
228
  Pindo::Command::Deploy::Build::run(args_temp)
192
229
  end
193
230
 
194
-
195
231
  Dir.chdir(current_dir)
196
232
  puts "Buiid Done !!!"
197
233
  puts "#{pindo_new_project_dir}"
@@ -45,6 +45,11 @@ module Pindo
45
45
  @args_send_flag = argv.flag?('send', false)
46
46
  @args_increase_flag = argv.flag?('increase', false)
47
47
 
48
+
49
+ if @args_send_flag
50
+ @args_upload_flag = true
51
+ end
52
+
48
53
  super
49
54
  end
50
55
 
@@ -67,9 +72,9 @@ module Pindo
67
72
  end
68
73
 
69
74
  if @args_increase_flag
70
- auto_increase_buildnumber(File.join(Dir.pwd, "config.json"))
75
+ auto_increase_buildnumber(app_config_file:File.join(Dir.pwd, "config.json"))
71
76
  app_config_repo_dir = File.join(pindo_single_config.pindo_dir, @deploy_identifier)
72
- auto_increase_buildnumber(File.join(app_config_repo_dir, "config.json"))
77
+ auto_increase_buildnumber(app_config_file:File.join(app_config_repo_dir, "config.json"))
73
78
  git_addpush_repo(path:app_config_repo_dir, message:"increate build number", commit_file_params:["config.json"])
74
79
  end
75
80