pindo 4.8.5 → 4.8.7
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 +42 -16
- data/lib/pindo/command/deploy/cert.rb +5 -10
- data/lib/pindo/command/dev/autobuild.rb +15 -1
- data/lib/pindo/command/dev/build.rb +1 -1
- data/lib/pindo/command/dev/debug.rb +21 -24
- data/lib/pindo/command/pgyer/upload.rb +2 -1
- data/lib/pindo/module/cert/certhelper.rb +11 -3
- data/lib/pindo/module/cert/xcodecerthelper.rb +116 -31
- data/lib/pindo/module/pgyer/pgyerhelper.rb +23 -1
- data/lib/pindo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24b5673e6e6b22077a55006939dc549e2b545537d935c6a004bed385dd936014
|
4
|
+
data.tar.gz: 699659aa13cff6c29fd5cbf63ba1a16707cb1ba6e8811f913094c968d4fcd09a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ae0851cb8497f852602e3fe26c49f6a1e69e0ba922c44833cf43abe12c186b6d1fec343ac29c3d62c1299c841dda8b0a0782caec8c952885a2fb9c1b0bd4805
|
7
|
+
data.tar.gz: 7ba1a294c60d4d1633e0f136a04d24712f7b01aec7c0702e890b8d7325e0261497897a67fbe55e1a9f63faaec566e70e8f98d52081c75c134bfbd3bd6953077a
|
@@ -119,7 +119,7 @@ module Pindo
|
|
119
119
|
proj_name = File.basename(project_fullname, ".xcodeproj")
|
120
120
|
project_obj = Xcodeproj::Project.open(project_fullname)
|
121
121
|
|
122
|
-
|
122
|
+
project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
123
123
|
main_target = project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) }.first
|
124
124
|
provisioning_profile_name = main_target.build_configurations.first.build_settings['PROVISIONING_PROFILE_SPECIFIER'].downcase.split(" ")
|
125
125
|
|
@@ -127,23 +127,49 @@ module Pindo
|
|
127
127
|
|
128
128
|
build_type = "app-store"
|
129
129
|
icloud_env = "Production"
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
130
|
+
|
131
|
+
if !project_build_platform.nil? && project_build_platform.eql?("macosx")
|
132
|
+
if provisioning_profile_name.include?("development")
|
133
|
+
# Mac development包
|
134
|
+
build_type = "development"
|
135
|
+
icloud_env = "Development"
|
136
|
+
elsif provisioning_profile_name.include?("appstore")
|
137
|
+
build_type = "mac-application"
|
138
|
+
icloud_env = "Production"
|
139
|
+
else
|
140
|
+
build_type = "developer-id"
|
141
|
+
icloud_env = "Production"
|
142
|
+
end
|
142
143
|
else
|
143
|
-
|
144
|
-
|
144
|
+
if provisioning_profile_name.include?("adhoc")
|
145
|
+
build_type = "ad-hoc"
|
146
|
+
icloud_env = "Development"
|
147
|
+
elsif provisioning_profile_name.include?("development")
|
148
|
+
build_type = "development"
|
149
|
+
icloud_env = "Development"
|
150
|
+
else
|
151
|
+
build_type = "app-store"
|
152
|
+
icloud_env = "Production"
|
153
|
+
end
|
145
154
|
end
|
146
155
|
|
156
|
+
# if provisioning_profile_name.include?("direct") && provisioning_profile_name.include?("macos")
|
157
|
+
# build_type = "developer-id"
|
158
|
+
# icloud_env = "Production"
|
159
|
+
# elsif provisioning_profile_name.include?("development") && provisioning_profile_name.include?("macos")
|
160
|
+
# build_type = "development"
|
161
|
+
# icloud_env = "Development"
|
162
|
+
# elsif provisioning_profile_name.include?("adhoc")
|
163
|
+
# build_type = "ad-hoc"
|
164
|
+
# icloud_env = "Development"
|
165
|
+
# elsif provisioning_profile_name.include?("development")
|
166
|
+
# build_type = "development"
|
167
|
+
# icloud_env = "Development"
|
168
|
+
# else
|
169
|
+
# build_type = "app-store"
|
170
|
+
# icloud_env = "Production"
|
171
|
+
# end
|
172
|
+
|
147
173
|
if build_type.eql?("app-store") || build_type.eql?("ad-hoc")
|
148
174
|
if File.exist?(File.join(project_path, "Unity/Data/Raw/SettingsPluginFlag.txt"))
|
149
175
|
raise Informative, "Unity代码包含测试模板,请重新导出Unity代码"
|
@@ -166,7 +192,7 @@ module Pindo
|
|
166
192
|
}
|
167
193
|
|
168
194
|
|
169
|
-
if !
|
195
|
+
if !project_build_platform.nil? && project_build_platform.eql?("macosx")
|
170
196
|
values[:output_name] = nil
|
171
197
|
values[:destination] = "generic/platform=macosx"
|
172
198
|
end
|
@@ -58,11 +58,6 @@ module Pindo
|
|
58
58
|
@build_type = "development"
|
59
59
|
end
|
60
60
|
|
61
|
-
@args_platform = "ios"
|
62
|
-
if @args_macos_flag
|
63
|
-
@args_platform = "macos"
|
64
|
-
end
|
65
|
-
|
66
61
|
end
|
67
62
|
|
68
63
|
def run
|
@@ -91,10 +86,6 @@ module Pindo
|
|
91
86
|
platform_type = "ios"
|
92
87
|
if @args_macos_flag
|
93
88
|
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
89
|
end
|
99
90
|
|
100
91
|
|
@@ -134,7 +125,7 @@ module Pindo
|
|
134
125
|
if !new_project_fullname.nil? && File.exist?(new_project_fullname) && !provisioning_info_array.nil? && provisioning_info_array.size > 0
|
135
126
|
new_proj_name = File.basename(new_project_fullname, ".xcodeproj")
|
136
127
|
Funlog.instance.fancyinfo_start("正在给Xcode配置证书...")
|
137
|
-
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
|
+
config_project_cert(new_proj_name:new_proj_name, new_project_dir:new_project_dir, cert_type:@build_type, platform_type:platform_type, team_id_vaule:@team_id_vaule, provisioning_info_array:provisioning_info_array)
|
138
129
|
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)
|
139
130
|
Funlog.instance.fancyinfo_success("Xcode配置证书完成!")
|
140
131
|
end
|
@@ -164,6 +155,10 @@ module Pindo
|
|
164
155
|
force_for_new_devices_flag = false
|
165
156
|
end
|
166
157
|
|
158
|
+
if platform_type.downcase.include?("macos") && build_type.eql?("adhoc")
|
159
|
+
build_type = "developer_id"
|
160
|
+
end
|
161
|
+
|
167
162
|
values = {
|
168
163
|
username:apple_id,
|
169
164
|
app_identifier: bundle_id_array,
|
@@ -114,13 +114,27 @@ module Pindo
|
|
114
114
|
args_temp << "--dev"
|
115
115
|
end
|
116
116
|
|
117
|
+
project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
|
118
|
+
if !project_fullname.nil?
|
119
|
+
project_obj = Xcodeproj::Project.open(project_fullname)
|
120
|
+
project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
121
|
+
if !project_build_platform.nil? && project_build_platform.eql?("macosx")
|
122
|
+
@args_macos_flag = true
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if @args_macos_flag
|
127
|
+
args_temp << "--macos"
|
128
|
+
end
|
129
|
+
|
117
130
|
Pindo::Command::Deploy::Cert::run(args_temp)
|
118
131
|
|
119
132
|
Dir.chdir(project_dir)
|
120
133
|
Pindo::Command::Deploy::Build::run(args_temp)
|
121
134
|
|
135
|
+
|
122
136
|
pindo_new_project_dir = Dir.pwd
|
123
|
-
build_path = File.join(pindo_new_project_dir, "build", "*.ipa")
|
137
|
+
build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
|
124
138
|
ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
125
139
|
|
126
140
|
if !ipa_file_upload.nil? && !app_info_obj.nil?
|
@@ -58,7 +58,7 @@ module Pindo
|
|
58
58
|
|
59
59
|
|
60
60
|
pindo_new_project_dir = Dir.pwd
|
61
|
-
build_path = File.join(pindo_new_project_dir, "build", "*.ipa")
|
61
|
+
build_path = File.join(pindo_new_project_dir, "build", "*.{ipa,app}")
|
62
62
|
ipa_file_upload = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
63
63
|
|
64
64
|
if !ipa_file_upload.nil? && !app_info_obj.nil?
|
@@ -66,6 +66,17 @@ module Pindo
|
|
66
66
|
args_temp << "--dev"
|
67
67
|
end
|
68
68
|
|
69
|
+
|
70
|
+
|
71
|
+
project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
|
72
|
+
if !project_fullname.nil?
|
73
|
+
project_obj = Xcodeproj::Project.open(project_fullname)
|
74
|
+
project_build_platform = project_obj.root_object.build_configuration_list.get_setting("SDKROOT")["Release"]
|
75
|
+
if !project_build_platform.nil? && project_build_platform.eql?("macosx")
|
76
|
+
@args_macos_flag = true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
69
80
|
if @args_macos_flag
|
70
81
|
args_temp << "--macos"
|
71
82
|
end
|
@@ -80,35 +91,22 @@ module Pindo
|
|
80
91
|
|
81
92
|
def self.modify_cert_with_project(project_dir:nil, config_file:nil)
|
82
93
|
|
83
|
-
|
84
|
-
project_fullname = ""
|
85
|
-
Dir.foreach(project_dir) do |file|
|
86
|
-
if file =~ /(.*).xcodeproj/
|
87
|
-
project_fullname = file
|
88
|
-
break;
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
94
|
+
project_fullname = Dir.glob(File.join(project_dir, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
|
92
95
|
if !project_fullname.nil?
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
temp_entitlements_file = target.build_configurations.first.build_settings['CODE_SIGN_ENTITLEMENTS']
|
102
|
-
if !temp_entitlements_file.nil? && !temp_entitlements_file.empty?
|
103
|
-
entitlements_plist_path = File.join(project_dir, temp_entitlements_file)
|
104
|
-
end
|
96
|
+
|
97
|
+
entitlements_plist_path = nil
|
98
|
+
project_obj = Xcodeproj::Project.open(project_fullname)
|
99
|
+
project_obj.targets.each do |target|
|
100
|
+
if target.product_type.to_s.eql?("com.apple.product-type.application") then
|
101
|
+
temp_entitlements_file = target.build_configurations.first.build_settings['CODE_SIGN_ENTITLEMENTS']
|
102
|
+
if !temp_entitlements_file.nil? && !temp_entitlements_file.empty?
|
103
|
+
entitlements_plist_path = File.join(project_dir, temp_entitlements_file)
|
105
104
|
end
|
106
105
|
end
|
107
106
|
end
|
108
107
|
|
109
108
|
# puts entitlements_plist_path
|
110
|
-
if File.exist?(entitlements_plist_path)
|
111
|
-
|
109
|
+
if !entitlements_plist_path.nil? && File.exist?(entitlements_plist_path)
|
112
110
|
config_json = nil
|
113
111
|
if File.exist?(config_file)
|
114
112
|
config_json = JSON.parse(File.read(config_file))
|
@@ -122,7 +120,6 @@ module Pindo
|
|
122
120
|
end
|
123
121
|
end
|
124
122
|
|
125
|
-
|
126
123
|
if entitlements_plist_dict["com.apple.security.application-groups"].nil?
|
127
124
|
if !config_json.nil? && !config_json["app_info"]['app_group_id'].nil?
|
128
125
|
config_json["app_info"].delete('app_group_id')
|
@@ -86,12 +86,13 @@ module Pindo
|
|
86
86
|
|
87
87
|
current_project_dir = Dir.pwd
|
88
88
|
if @args_ipa_file.nil? || !File.exist?(@args_ipa_file)
|
89
|
-
build_path = File.join(current_project_dir, "build", "*.ipa")
|
89
|
+
build_path = File.join(current_project_dir, "build", "*.{ipa,app}")
|
90
90
|
@args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
91
91
|
if @args_ipa_file.nil?
|
92
92
|
build_path = File.join(current_project_dir, "*.ipa")
|
93
93
|
@args_ipa_file = Dir.glob(build_path).max_by {|f| File.mtime(f)}
|
94
94
|
end
|
95
|
+
|
95
96
|
if !@args_ipa_file.nil?
|
96
97
|
answer = agree("需要上传的ipa文件是: #{@args_ipa_file} ?(Y/n)")
|
97
98
|
if !answer
|
@@ -66,10 +66,12 @@ module Pindo
|
|
66
66
|
|
67
67
|
cert_git_dir = cert_type.downcase
|
68
68
|
if platform_type.downcase.eql?("macos")
|
69
|
-
if
|
70
|
-
cert_git_dir = "developer_id_application"
|
71
|
-
else
|
69
|
+
if cert_type.downcase.include?("development")
|
72
70
|
cert_git_dir = "development"
|
71
|
+
elsif cert_type.downcase.eql?("appstore")
|
72
|
+
cert_git_dir = "distribution"
|
73
|
+
else
|
74
|
+
cert_git_dir = "developer_id_application"
|
73
75
|
end
|
74
76
|
else
|
75
77
|
if !cert_type.downcase.include?("development")
|
@@ -133,16 +135,22 @@ module Pindo
|
|
133
135
|
cert_sub_dir = cert_type.downcase
|
134
136
|
provision_start_name = "Development"
|
135
137
|
provision_extension_name = ".mobileprovision"
|
138
|
+
|
136
139
|
if platform_type.downcase.include?("macos")
|
137
140
|
provision_extension_name = ".provisionprofile"
|
141
|
+
|
138
142
|
if cert_type.downcase.include?("development")
|
139
143
|
provision_start_name = "Development"
|
140
144
|
cert_sub_dir = cert_type.downcase
|
145
|
+
elsif cert_type.downcase.eql?("appstore")
|
146
|
+
provision_start_name = "AppStore"
|
147
|
+
cert_sub_dir = "appstore"
|
141
148
|
else
|
142
149
|
provision_start_name = "Direct"
|
143
150
|
cert_sub_dir = "developer_id"
|
144
151
|
end
|
145
152
|
else
|
153
|
+
provision_extension_name = ".mobileprovision"
|
146
154
|
if cert_type.downcase.include?("development")
|
147
155
|
provision_start_name = "Development"
|
148
156
|
cert_sub_dir = cert_type.downcase
|
@@ -34,22 +34,30 @@ module Pindo
|
|
34
34
|
provisioning_info = {}
|
35
35
|
provisioning_info['type'] = type
|
36
36
|
provisioning_info['bundle_id'] = bundle_id_temp
|
37
|
-
|
37
|
+
|
38
|
+
|
39
|
+
match_build_type = build_type
|
40
|
+
if platform_type.downcase.include?("macos") && match_build_type.downcase.include?("adhoc")
|
41
|
+
match_build_type = "developer_id"
|
42
|
+
end
|
43
|
+
|
44
|
+
name_temp = Match::Utils.environment_variable_name_profile_name(app_identifier: bundle_id_temp, type: match_build_type, platform:platform_type)
|
38
45
|
provisioning_info['profile_name'] = ENV[name_temp]
|
39
|
-
path_temp = Match::Utils.environment_variable_name_profile_path(app_identifier:bundle_id_temp,type:
|
46
|
+
path_temp = Match::Utils.environment_variable_name_profile_path(app_identifier:bundle_id_temp,type: match_build_type, platform:platform_type)
|
40
47
|
provisioning_info['profile_path'] = ENV[path_temp]
|
41
|
-
signing_identity_key=Match::Utils.environment_variable_name_certificate_name(app_identifier: bundle_id_temp,type:
|
48
|
+
signing_identity_key=Match::Utils.environment_variable_name_certificate_name(app_identifier: bundle_id_temp,type: match_build_type, platform:platform_type)
|
42
49
|
provisioning_info["signing_identity"] = ENV[signing_identity_key]
|
43
|
-
team_id_key = Match::Utils.environment_variable_name_team_id(app_identifier: bundle_id_temp,type:
|
50
|
+
team_id_key = Match::Utils.environment_variable_name_team_id(app_identifier: bundle_id_temp,type:match_build_type, platform:platform_type)
|
44
51
|
provisioning_info["team_id"] = ENV[team_id_key]
|
45
52
|
provisioning_info_array << provisioning_info
|
53
|
+
|
46
54
|
end
|
47
55
|
|
48
56
|
|
49
57
|
return provisioning_info_array
|
50
58
|
end
|
51
59
|
|
52
|
-
def config_project_cert(new_proj_name:nil, new_project_dir:nil, cert_type:nil, team_id_vaule:nil, provisioning_info_array:nil)
|
60
|
+
def config_project_cert(new_proj_name:nil, new_project_dir:nil, cert_type:nil, platform_type:nil, team_id_vaule:nil, provisioning_info_array:nil)
|
53
61
|
|
54
62
|
|
55
63
|
new_proj_fullname = File.join(new_project_dir, new_proj_name) + ".xcodeproj"
|
@@ -58,11 +66,36 @@ module Pindo
|
|
58
66
|
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=iphoneos*]', "Apple Distribution")
|
59
67
|
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Apple Distribution")
|
60
68
|
|
61
|
-
if
|
62
|
-
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=iphoneos*]',
|
63
|
-
new_project_obj.root_object.build_configuration_list.
|
69
|
+
if !platform_type.nil? && platform_type.downcase.eql?("macos")
|
70
|
+
# new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=iphoneos*]', nil)
|
71
|
+
new_project_obj.root_object.build_configuration_list.build_configurations.each do |config|
|
72
|
+
config.build_settings.delete('CODE_SIGN_IDENTITY[sdk=iphoneos*]') if config.build_settings.key?('CODE_SIGN_IDENTITY[sdk=iphoneos*]')
|
73
|
+
end
|
74
|
+
|
75
|
+
if cert_type.downcase.eql?("development")
|
76
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=macosx*]', "Apple Development")
|
77
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Apple Development")
|
78
|
+
elsif cert_type.downcase.eql?("appstore")
|
79
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=macosx*]', "Apple Distribution")
|
80
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Apple Distribution")
|
81
|
+
else
|
82
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=macosx*]', "Developer ID Application")
|
83
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Developer ID Application")
|
84
|
+
end
|
85
|
+
else
|
86
|
+
new_project_obj.root_object.build_configuration_list.build_configurations.each do |config|
|
87
|
+
config.build_settings.delete('CODE_SIGN_IDENTITY[sdk=macosx*]') if config.build_settings.key?('CODE_SIGN_IDENTITY[sdk=macosx*]')
|
88
|
+
end
|
89
|
+
if cert_type.downcase.eql?("development")
|
90
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=iphoneos*]', "Apple Development")
|
91
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Apple Development")
|
92
|
+
else
|
93
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY[sdk=iphoneos*]', "Apple Distribution")
|
94
|
+
new_project_obj.root_object.build_configuration_list.set_setting('CODE_SIGN_IDENTITY*', "Apple Distribution")
|
95
|
+
end
|
64
96
|
end
|
65
97
|
|
98
|
+
|
66
99
|
new_project_obj.root_object.attributes['TargetAttributes'] = new_project_obj.root_object.attributes['TargetAttributes'] || {}
|
67
100
|
target_atts_obj = new_project_obj.root_object.attributes['TargetAttributes']
|
68
101
|
|
@@ -97,22 +130,64 @@ module Pindo
|
|
97
130
|
target_atts_obj[target.uuid]['DevelopmentTeam'] = team_id_vaule
|
98
131
|
target_atts_obj[target.uuid]['ProvisioningStyle'] = "Manual"
|
99
132
|
config.build_settings['DEVELOPMENT_TEAM'] = team_id_vaule
|
100
|
-
config.build_settings['DEVELOPMENT_TEAM[sdk=iphoneos*]'] = team_id_vaule
|
101
133
|
config.build_settings['CODE_SIGN_STYLE'] = "Manual"
|
102
134
|
|
103
135
|
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Distribution"
|
104
136
|
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Distribution"
|
105
|
-
|
106
|
-
if cert_type == "development"
|
107
|
-
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Development"
|
108
|
-
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Development"
|
109
|
-
end
|
110
137
|
|
111
|
-
if !
|
112
|
-
|
113
|
-
config.build_settings['
|
114
|
-
config.build_settings['
|
138
|
+
if !platform_type.nil? && platform_type.downcase.eql?("macos")
|
139
|
+
|
140
|
+
config.build_settings['DEVELOPMENT_TEAM[sdk=macosx*]'] = team_id_vaule
|
141
|
+
# config.build_settings['DEVELOPMENT_TEAM[sdk=iphoneos*]'] = nil
|
142
|
+
# config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = nil
|
143
|
+
# config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]'] = nil
|
144
|
+
|
145
|
+
config.build_settings.delete('DEVELOPMENT_TEAM[sdk=iphoneos*]') if config.build_settings.key?('DEVELOPMENT_TEAM[sdk=iphoneos*]')
|
146
|
+
config.build_settings.delete('CODE_SIGN_IDENTITY[sdk=iphoneos*]') if config.build_settings.key?('CODE_SIGN_IDENTITY[sdk=iphoneos*]')
|
147
|
+
config.build_settings.delete('PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]') if config.build_settings.key?('PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]')
|
148
|
+
|
115
149
|
|
150
|
+
|
151
|
+
if cert_type.downcase.eql?("development")
|
152
|
+
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Development"
|
153
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = "Apple Development"
|
154
|
+
elsif cert_type.downcase.eql?("appstore")
|
155
|
+
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Distribution"
|
156
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = "Apple Distribution"
|
157
|
+
else
|
158
|
+
config.build_settings['CODE_SIGN_IDENTITY'] = "Developer ID Application"
|
159
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = "Developer ID Application"
|
160
|
+
end
|
161
|
+
|
162
|
+
if !provisioning_info.nil?
|
163
|
+
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = provisioning_info["bundle_id"]
|
164
|
+
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = provisioning_info['profile_name']
|
165
|
+
config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]'] = provisioning_info['profile_name']
|
166
|
+
end
|
167
|
+
|
168
|
+
else
|
169
|
+
config.build_settings['DEVELOPMENT_TEAM[sdk=iphoneos*]'] = team_id_vaule
|
170
|
+
# config.build_settings['DEVELOPMENT_TEAM[sdk=macosx*]'] = ""
|
171
|
+
# config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = ""
|
172
|
+
# config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]'] = ""
|
173
|
+
|
174
|
+
config.build_settings.delete('DEVELOPMENT_TEAM[sdk=macosx*]') if config.build_settings.key?('DEVELOPMENT_TEAM[sdk=macosx*]')
|
175
|
+
config.build_settings.delete('CODE_SIGN_IDENTITY[sdk=macosx*]') if config.build_settings.key?('CODE_SIGN_IDENTITY[sdk=macosx*]')
|
176
|
+
config.build_settings.delete('PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]') if config.build_settings.key?('PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]')
|
177
|
+
|
178
|
+
|
179
|
+
if cert_type.downcase.eql?("development")
|
180
|
+
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Development"
|
181
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Development"
|
182
|
+
else
|
183
|
+
config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Distribution"
|
184
|
+
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Distribution"
|
185
|
+
end
|
186
|
+
if !provisioning_info.nil?
|
187
|
+
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = provisioning_info["bundle_id"]
|
188
|
+
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = provisioning_info['profile_name']
|
189
|
+
config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]'] = provisioning_info['profile_name']
|
190
|
+
end
|
116
191
|
end
|
117
192
|
end
|
118
193
|
end
|
@@ -232,13 +307,16 @@ module Pindo
|
|
232
307
|
if !File.exist?(cert_dest_dir)
|
233
308
|
FileUtils.mkdir_p(cert_dest_dir)
|
234
309
|
end
|
235
|
-
|
310
|
+
cert_type_temp = cert_type
|
236
311
|
cert_sub_dir = cert_type.downcase
|
237
312
|
if platform_type.downcase.eql?("macos")
|
238
|
-
if
|
239
|
-
cert_sub_dir = "developer_id_application"
|
240
|
-
else
|
313
|
+
if cert_type.downcase.include?("development")
|
241
314
|
cert_sub_dir = "development"
|
315
|
+
elsif cert_type.downcase.eql?("appstore")
|
316
|
+
cert_sub_dir = "distribution"
|
317
|
+
else
|
318
|
+
cert_type_temp = "developer_id"
|
319
|
+
cert_sub_dir = "developer_id_application"
|
242
320
|
end
|
243
321
|
else
|
244
322
|
if !cert_type.downcase.include?("development")
|
@@ -263,7 +341,7 @@ module Pindo
|
|
263
341
|
raise Informative, "证书解析失败,密码错误!"
|
264
342
|
end
|
265
343
|
|
266
|
-
FileUtils.copy(key_path, File.join(cert_dest_dir, "#{
|
344
|
+
FileUtils.copy(key_path, File.join(cert_dest_dir, "#{cert_type_temp}.p12"))
|
267
345
|
|
268
346
|
end
|
269
347
|
|
@@ -312,18 +390,15 @@ module Pindo
|
|
312
390
|
account_cert_set["certs"].delete_if { |x| x["cert_id"].eql?(bundle_id_signing_identity)}
|
313
391
|
end
|
314
392
|
|
315
|
-
cert_item["cert_id"] = cert_item["cert_id"] || bundle_id_signing_identity
|
316
|
-
cert_item["password"] = "goodcert1"
|
317
|
-
cert_item["cert_file"] = "#{cert_type}.p12"
|
318
|
-
cert_item["cert_type"] = cert_type
|
319
|
-
cert_item["cert_provisioning_group"] = cert_item["cert_provisioning_group"] || []
|
320
|
-
|
321
|
-
|
322
393
|
provision_start_name = "Development"
|
394
|
+
cert_type_temp = cert_type
|
323
395
|
if platform_type.downcase.include?("macos")
|
324
396
|
if cert_type.downcase.include?("development")
|
325
397
|
provision_start_name = "development"
|
398
|
+
elsif cert_type.downcase.eql?("appstore")
|
399
|
+
provision_start_name = "appstore"
|
326
400
|
else
|
401
|
+
cert_type_temp = "developer_id"
|
327
402
|
provision_start_name = "direct"
|
328
403
|
end
|
329
404
|
else
|
@@ -336,8 +411,17 @@ module Pindo
|
|
336
411
|
end
|
337
412
|
end
|
338
413
|
|
414
|
+
cert_item["cert_id"] = cert_item["cert_id"] || bundle_id_signing_identity
|
415
|
+
cert_item["password"] = "goodcert1"
|
416
|
+
cert_item["cert_file"] = "#{cert_type_temp}.p12"
|
417
|
+
cert_item["cert_type"] = cert_type_temp
|
418
|
+
cert_item["cert_provisioning_group"] = cert_item["cert_provisioning_group"] || []
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
339
423
|
cert_provisioning_group_item = {}
|
340
|
-
provisioning_group_id = [
|
424
|
+
provisioning_group_id = [cert_type_temp, platform_type, bundle_id].join("_")
|
341
425
|
|
342
426
|
provisioning_group_result = cert_item["cert_provisioning_group"].select { |x| x["provisioning_group_id"].eql?(provisioning_group_id)}.first
|
343
427
|
if provisioning_group_result.nil?
|
@@ -361,6 +445,7 @@ module Pindo
|
|
361
445
|
bundle_id_temp = provisioning_info['bundle_id']
|
362
446
|
provisioning_id = [provision_start_name, bundle_id_temp].join("_")
|
363
447
|
real_path = provisioning_info["profile_path"]
|
448
|
+
|
364
449
|
extname = File.extname(real_path)
|
365
450
|
cert_provisioning_group_item["provisioning_items"] << {
|
366
451
|
"bundle_id" => bundle_id_temp,
|
@@ -145,7 +145,29 @@ module Pindo
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def start_upload(app_info_obj:nil, ipa_file_upload:nil, description:nil)
|
148
|
+
if !ipa_file_upload.nil? && File.extname(ipa_file_upload).eql?(".app")
|
149
|
+
mac_app_path = ipa_file_upload
|
150
|
+
ipa_base_dir = File.dirname(ipa_file_upload)
|
151
|
+
ipa_base_name = File.basename(ipa_file_upload, File.extname(ipa_file_upload))
|
152
|
+
ipa_file_upload = File.join(ipa_base_dir, ipa_base_name + ".zip")
|
153
|
+
if File.exist?(ipa_file_upload)
|
154
|
+
FileUtils.rm_rf(ipa_file_upload)
|
155
|
+
end
|
156
|
+
|
157
|
+
current_dir = Dir.pwd
|
158
|
+
if File.exist?(ipa_base_dir)
|
159
|
+
Dir.chdir(ipa_base_dir)
|
160
|
+
base_name = File.basename(mac_app_path)
|
161
|
+
command = "zip -qry \"#{ipa_file_upload}\" \"#{base_name}\""
|
162
|
+
puts command
|
163
|
+
system command
|
164
|
+
Dir.chdir(current_dir)
|
165
|
+
end
|
166
|
+
end
|
148
167
|
|
168
|
+
unless !ipa_file_upload.nil? && File.exist?(ipa_file_upload)
|
169
|
+
return
|
170
|
+
end
|
149
171
|
args_ipa_file_dir = File.expand_path(File::dirname(ipa_file_upload))
|
150
172
|
ipa_file_upload=File.join(args_ipa_file_dir, File.basename(ipa_file_upload))
|
151
173
|
current_project_dir = Dir.pwd
|
@@ -203,7 +225,7 @@ module Pindo
|
|
203
225
|
# aws_client = AWSS3Client.new
|
204
226
|
aws_client = PgyerUploadClient.new
|
205
227
|
upload_res = aws_client.upload_file(binary_file:ipa_file_upload)
|
206
|
-
|
228
|
+
puts upload_res
|
207
229
|
attach_key_url = nil
|
208
230
|
attachFileUrls = []
|
209
231
|
|
data/lib/pindo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pindo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.8.
|
4
|
+
version: 4.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: claide
|