pindo 4.8.2 → 4.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pindo/command/deploy/build.rb +22 -1
- data/lib/pindo/command/deploy/cert.rb +24 -13
- data/lib/pindo/command/deploy/configproj.rb +3 -2
- data/lib/pindo/command/dev/debug.rb +7 -0
- data/lib/pindo/config/pindouserlocalconfig.rb +35 -1
- data/lib/pindo/module/appstore/appstore_in_app_purchase.rb +10 -8
- data/lib/pindo/module/appstore/appstore_metadata_fastlane_helper.rb +185 -92
- data/lib/pindo/module/cert/certhelper.rb +40 -16
- data/lib/pindo/module/cert/xcodecerthelper.rb +50 -22
- data/lib/pindo/module/pgyer/pgyerhelper.rb +34 -6
- data/lib/pindo/module/xcode/xcodeappconfig.rb +27 -3
- data/lib/pindo/module/xcode/xcodebuildhelper.rb +15 -5
- data/lib/pindo/module/xcode/xcoderesconstant.rb +169 -116
- data/lib/pindo/module/xcode/xcodereshandler.rb +78 -93
- data/lib/pindo/module/xcode/xcodereshelper.rb +2 -2
- data/lib/pindo/options/deployoptions.rb +9 -0
- data/lib/pindo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f77f41090639d86cb2f9c9d9f2cfc70658700c79066a08a312936ed75f4297df
|
4
|
+
data.tar.gz: afe8ad53ca20bda0c124c6df7a0f76a554555fdac9eea2ddfe635204fdec9f3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e985bb992fc5e25a81a7b977be5a4d6c8be69052f2b200496ec838b9118f995f8b8384dde96a0f534cc795e0c034796b1c84a1b075bdabc8f1f036ce47a33c
|
7
|
+
data.tar.gz: 15082bfd14a5e2a4aa3e780b3455b5ca6a22486280889f9b5103bcc771b282115da6097936c2121bdd6bac60e5b11809ae03dca222388f1d94a00b6c419c6667
|
@@ -118,12 +118,22 @@ module Pindo
|
|
118
118
|
project_path = File.dirname(project_fullname)
|
119
119
|
proj_name = File.basename(project_fullname, ".xcodeproj")
|
120
120
|
project_obj = Xcodeproj::Project.open(project_fullname)
|
121
|
+
|
122
|
+
build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
121
123
|
main_target = project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) }.first
|
122
124
|
provisioning_profile_name = main_target.build_configurations.first.build_settings['PROVISIONING_PROFILE_SPECIFIER'].downcase.split(" ")
|
123
125
|
|
126
|
+
|
127
|
+
|
124
128
|
build_type = "app-store"
|
125
129
|
icloud_env = "Production"
|
126
|
-
if provisioning_profile_name.include?("
|
130
|
+
if provisioning_profile_name.include?("direct") && provisioning_profile_name.include?("macos")
|
131
|
+
build_type = "developer-id"
|
132
|
+
icloud_env = "Production"
|
133
|
+
elsif provisioning_profile_name.include?("development") && provisioning_profile_name.include?("macos")
|
134
|
+
build_type = "development"
|
135
|
+
icloud_env = "Development"
|
136
|
+
elsif provisioning_profile_name.include?("adhoc")
|
127
137
|
build_type = "ad-hoc"
|
128
138
|
icloud_env = "Development"
|
129
139
|
elsif provisioning_profile_name.include?("development")
|
@@ -134,6 +144,12 @@ module Pindo
|
|
134
144
|
icloud_env = "Production"
|
135
145
|
end
|
136
146
|
|
147
|
+
if build_type.eql?("app-store") || build_type.eql?("ad-hoc")
|
148
|
+
if File.exist?(File.join(project_path, "Unity/Data/Raw/SettingsPluginFlag.txt"))
|
149
|
+
raise Informative, "Unity代码包含测试模板,请重新导出Unity代码"
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
137
153
|
|
138
154
|
app_ipaname_temp = main_target.build_configurations.first.build_settings['INFOPLIST_KEY_CFBundleDisplayName'] || main_target.display_name
|
139
155
|
app_ipaname_temp = app_ipaname_temp.gsub(/ /, '');
|
@@ -150,6 +166,11 @@ module Pindo
|
|
150
166
|
}
|
151
167
|
|
152
168
|
|
169
|
+
if !build_platform.nil? && build_platform.eql?("macosx")
|
170
|
+
values[:output_name] = nil
|
171
|
+
values[:destination] = "generic/platform=macosx"
|
172
|
+
end
|
173
|
+
|
153
174
|
if File.exist?(File.join(project_path, "Podfile"))
|
154
175
|
values[:workspace] = "#{proj_name}.xcworkspace"
|
155
176
|
values[:project] = nil
|
@@ -32,6 +32,7 @@ module Pindo
|
|
32
32
|
[
|
33
33
|
['--dev', '操作dev证书'],
|
34
34
|
['--adhoc', '操作adhoc证书'],
|
35
|
+
['--macos', 'macos平台证书'],
|
35
36
|
['--clean', '删除本地缓存的证书'],
|
36
37
|
['--cleangit', '删除远程仓库中的证书'],
|
37
38
|
['--upload', '生成上传pgyer的证书'],
|
@@ -57,6 +58,11 @@ module Pindo
|
|
57
58
|
@build_type = "development"
|
58
59
|
end
|
59
60
|
|
61
|
+
@args_platform = "ios"
|
62
|
+
if @args_macos_flag
|
63
|
+
@args_platform = "macos"
|
64
|
+
end
|
65
|
+
|
60
66
|
end
|
61
67
|
|
62
68
|
def run
|
@@ -81,11 +87,22 @@ module Pindo
|
|
81
87
|
bundle_id_array = get_bundle_id_map.values
|
82
88
|
provisioning_info_array = nil
|
83
89
|
|
90
|
+
|
91
|
+
platform_type = "ios"
|
92
|
+
if @args_macos_flag
|
93
|
+
platform_type = "macos"
|
94
|
+
else
|
95
|
+
if @config_json && @config_json['project_info'] && @config_json['project_info']['build_type'].include?("MacOS")
|
96
|
+
platform_type = "macos"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
|
84
101
|
if @renew_cert_flag || @match_flag
|
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)
|
102
|
+
values = get_create_cert_match_values(apple_id:@apple_id, bundle_id_array:bundle_id_array, build_type:@build_type, platform_type:platform_type, renew_flag:@renew_cert_flag)
|
86
103
|
config = FastlaneCore::Configuration.create(Match::Options.available_options, values)
|
87
104
|
Match::Runner.new.run(config)
|
88
|
-
provisioning_info_array = create_provisioning_info_array(build_type:@build_type)
|
105
|
+
provisioning_info_array = create_provisioning_info_array(build_type:@build_type, platform_type:platform_type)
|
89
106
|
pindo_single_config.set_cert_info(dict: provisioning_info_array)
|
90
107
|
|
91
108
|
else
|
@@ -96,10 +113,9 @@ module Pindo
|
|
96
113
|
cert_reponame = cert_git_url.split("/").last.chomp(".git")
|
97
114
|
certs_dir = getcode_to_dir(reponame:cert_reponame, remote_url:cert_git_url, path: pindo_single_config.pindo_dir, new_branch:@apple_id)
|
98
115
|
|
99
|
-
install_certs(cert_url:cert_git_url, certs_dir:certs_dir, cert_type:@build_type)
|
116
|
+
install_certs(cert_url:cert_git_url, certs_dir:certs_dir, cert_type:@build_type, platform_type:platform_type)
|
100
117
|
bundle_id_map = get_bundle_id_map
|
101
|
-
|
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)
|
118
|
+
provisioning_info_array = install_provisionfiles(cert_url:cert_git_url, certs_dir:certs_dir, bundle_id_map:bundle_id_map, cert_type:@build_type, platform_type:platform_type)
|
103
119
|
pindo_single_config.set_cert_info(dict: provisioning_info_array)
|
104
120
|
end
|
105
121
|
|
@@ -124,12 +140,12 @@ module Pindo
|
|
124
140
|
end
|
125
141
|
|
126
142
|
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)
|
143
|
+
create_upload_cert_info(apple_id:@apple_id, cert_type:@build_type, platform_type:platform_type)
|
144
|
+
create_upload_provisioning_info(apple_id:@apple_id, cert_type:@build_type, platform_type:platform_type, provisioning_info_array:provisioning_info_array)
|
129
145
|
end
|
130
146
|
end
|
131
147
|
|
132
|
-
def get_create_cert_match_values(apple_id:nil, bundle_id_array:nil, build_type:nil, renew_flag:false)
|
148
|
+
def get_create_cert_match_values(apple_id:nil, bundle_id_array:nil, build_type:nil, platform_type:nil, renew_flag:false)
|
133
149
|
|
134
150
|
if build_type.eql?("appstore") && (apple_id.eql?(pindo_single_config.demo_apple_id))
|
135
151
|
raise Informative, "#{apple_id} 是测试账号,不能创建appstore证书!!!"
|
@@ -148,11 +164,6 @@ module Pindo
|
|
148
164
|
force_for_new_devices_flag = false
|
149
165
|
end
|
150
166
|
|
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
167
|
values = {
|
157
168
|
username:apple_id,
|
158
169
|
app_identifier: bundle_id_array,
|
@@ -69,8 +69,9 @@ module Pindo
|
|
69
69
|
end
|
70
70
|
|
71
71
|
Funlog.instance.fancyinfo_start("正在替换启动页...")
|
72
|
-
|
73
|
-
|
72
|
+
|
73
|
+
launchimg_pub_path = File.join(app_config_dir,"launch")
|
74
|
+
XcodeResHelper.install_launchimg(proj_dir:current_dir, launchimg_pub_path:launchimg_pub_path)
|
74
75
|
Funlog.instance.fancyinfo_success("启动页处理完成!")
|
75
76
|
|
76
77
|
add_project_modue(project_dir:current_dir, proj_name:@proj_name, config_json:@config_json)
|
@@ -26,6 +26,7 @@ module Pindo
|
|
26
26
|
[
|
27
27
|
['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id'],
|
28
28
|
['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书'],
|
29
|
+
['--macos', 'macos平台证书'],
|
29
30
|
['--upload', '生成上传pgyer的证书'],
|
30
31
|
].concat(super)
|
31
32
|
end
|
@@ -33,6 +34,7 @@ module Pindo
|
|
33
34
|
def initialize(argv)
|
34
35
|
@args_adhoc_flag = argv.flag?('adhoc', false)
|
35
36
|
@args_deploy_flag = argv.flag?('deploy', false)
|
37
|
+
@args_macos_flag = argv.flag?('macos', false)
|
36
38
|
@upload_flag = argv.flag?('upload', false)
|
37
39
|
super
|
38
40
|
end
|
@@ -64,9 +66,14 @@ module Pindo
|
|
64
66
|
args_temp << "--dev"
|
65
67
|
end
|
66
68
|
|
69
|
+
if @args_macos_flag
|
70
|
+
args_temp << "--macos"
|
71
|
+
end
|
72
|
+
|
67
73
|
if @upload_flag
|
68
74
|
args_temp << "--upload"
|
69
75
|
end
|
76
|
+
|
70
77
|
Pindo::Command::Deploy::Cert::run(args_temp)
|
71
78
|
|
72
79
|
end
|
@@ -56,7 +56,41 @@ module Pindo
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
|
59
|
+
|
60
|
+
def get_last_work_project_array()
|
61
|
+
last_work_project_array = nil
|
62
|
+
if !@pindo_user_local_config_json.nil?
|
63
|
+
last_work_project_array = @pindo_user_local_config_json["last_work_project_array"] || []
|
64
|
+
end
|
65
|
+
return last_work_project_array;
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
def write_last_work_project(proj_name:nil)
|
70
|
+
if proj_name.nil?
|
71
|
+
return
|
72
|
+
end
|
73
|
+
if proj_name.length < 1
|
74
|
+
return
|
75
|
+
end
|
76
|
+
|
77
|
+
last_work_project_array = @pindo_user_local_config_json["last_work_project_array"] || []
|
78
|
+
|
79
|
+
# 从数组中删除目标字符串
|
80
|
+
last_work_project_array.delete(proj_name)
|
81
|
+
# 将目标字符串插入到数组末尾
|
82
|
+
last_work_project_array.unshift(proj_name)
|
83
|
+
# 如果数组长度超过5,删除第一个元素
|
84
|
+
last_work_project_array.pop if last_work_project_array.length > 6
|
85
|
+
last_work_project_array.pop if last_work_project_array.length > 6
|
86
|
+
|
87
|
+
@pindo_user_local_config_json["last_work_project_array"] = last_work_project_array
|
88
|
+
File.open(@pindo_user_local_config_file, "w") do |file|
|
89
|
+
file.write(JSON.pretty_generate(@pindo_user_local_config_json))
|
90
|
+
file.close
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
60
94
|
|
61
95
|
|
62
96
|
def self.reload_instance
|
@@ -78,7 +78,7 @@ module Pindo
|
|
78
78
|
begin
|
79
79
|
client = Spaceship::ConnectAPI
|
80
80
|
app_sharedsecrets_item = nil
|
81
|
-
response = client.tunes_request_client.get("apps/#{app_id}/appSharedSecrets")
|
81
|
+
response = client.tunes_request_client.get("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/apps/#{app_id}/appSharedSecrets")
|
82
82
|
# puts JSON.pretty_generate(response.body)
|
83
83
|
result_data = response.body
|
84
84
|
|
@@ -1128,6 +1128,7 @@ module Pindo
|
|
1128
1128
|
|
1129
1129
|
itc_usa_latest_price = nil
|
1130
1130
|
itc_usa_latest_start_date = nil
|
1131
|
+
itc_usa_latest_price_point_id = nil
|
1131
1132
|
need_modify_price = true
|
1132
1133
|
|
1133
1134
|
if subscription_item["state"].to_s.eql?("APPROVED")
|
@@ -1168,6 +1169,7 @@ module Pindo
|
|
1168
1169
|
include_item = respose_price[:included].last
|
1169
1170
|
if include_item[:type].to_s.eql?("subscriptionPricePoints")
|
1170
1171
|
itc_usa_latest_price = include_item[:attributes][:customer_price]
|
1172
|
+
itc_usa_latest_price_point_id = include_item[:id]
|
1171
1173
|
puts " 最新线上价格:" + itc_usa_latest_price +"$"
|
1172
1174
|
end
|
1173
1175
|
end
|
@@ -1280,10 +1282,10 @@ module Pindo
|
|
1280
1282
|
}
|
1281
1283
|
}
|
1282
1284
|
|
1283
|
-
price_change_relationships_data[:newSubscriptionPricePoints][:data] << {
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1285
|
+
# price_change_relationships_data[:newSubscriptionPricePoints][:data] << {
|
1286
|
+
# type:"subscriptionPricePoints",
|
1287
|
+
# id: price_point_id
|
1288
|
+
# }
|
1287
1289
|
|
1288
1290
|
index_num = index_num +1
|
1289
1291
|
|
@@ -1368,7 +1370,7 @@ module Pindo
|
|
1368
1370
|
|
1369
1371
|
if last_data_items.size > 0
|
1370
1372
|
last_data_items.each do |last_data_item|
|
1371
|
-
if last_data_item[:type].to_s.eql?("subscriptionPrices")
|
1373
|
+
if last_data_item[:type].to_s.eql?("subscriptionPrices") && !last_data_item[:relationships][:subscription_price_point][:data][:id].eql?(itc_usa_latest_price_point_id)
|
1372
1374
|
price_change_relationships_data[:currentSubscriptionPricePoints][:data] << {
|
1373
1375
|
type:"subscriptionPricePoints",
|
1374
1376
|
id: last_data_item[:relationships][:subscription_price_point][:data][:id]
|
@@ -1392,7 +1394,7 @@ module Pindo
|
|
1392
1394
|
|
1393
1395
|
begin
|
1394
1396
|
|
1395
|
-
respose_price = client.tunes_request_client.post("subscriptionPriceChangeConsentReasons", body)
|
1397
|
+
respose_price = client.tunes_request_client.post("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/subscriptionPriceChangeConsentReasons", body)
|
1396
1398
|
|
1397
1399
|
# puts JSON.pretty_generate(respose_price)
|
1398
1400
|
rescue => err
|
@@ -1418,7 +1420,7 @@ module Pindo
|
|
1418
1420
|
# puts "included_data.size: #{included_data.size}"
|
1419
1421
|
# puts JSON.pretty_generate(body)
|
1420
1422
|
|
1421
|
-
respose_price = client.tunes_request_client.patch("subscriptions/#{subscription_id}", body)
|
1423
|
+
respose_price = client.tunes_request_client.patch("#{Spaceship::ConnectAPI::Tunes::API::Version::V1}/subscriptions/#{subscription_id}", body)
|
1422
1424
|
# respose_price = appstore_client.update_subscription(
|
1423
1425
|
# id:subscription_id,
|
1424
1426
|
# relationships: relationships_data,
|