pindo 4.7.0 → 4.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,12 +69,17 @@ module Pindo
69
69
 
70
70
  new_project_obj.targets.each do |target|
71
71
 
72
+ if target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:framework]) || target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:dynamic_library]) ||
73
+ target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:static_library]) || target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:bundle])
74
+ next
75
+ end
72
76
  provisioning_info = nil
73
77
 
74
78
  if target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application])
75
79
  bundle_id_map_key = target_map["MainTarget"]
76
80
  provisioning_info = provisioning_info_array.select { |s| s["type"].to_s.eql?(bundle_id_map_key.to_s) }.first
77
- elsif
81
+ else
82
+
78
83
  target_map.each do |k, v|
79
84
  if target.name.to_s.end_with?(k)
80
85
  bundle_id_map_key = v.to_s
@@ -83,29 +88,34 @@ module Pindo
83
88
  end
84
89
  end
85
90
 
86
- target.build_configurations.each do |config|
87
- target_atts_obj[target.uuid] = target_atts_obj[target.uuid] || {}
88
- target_atts_obj[target.uuid]['DevelopmentTeam'] = team_id_vaule
89
- target_atts_obj[target.uuid]['ProvisioningStyle'] = "Manual"
90
- config.build_settings['DEVELOPMENT_TEAM'] = team_id_vaule
91
- config.build_settings['DEVELOPMENT_TEAM[sdk=iphoneos*]'] = team_id_vaule
92
- config.build_settings['CODE_SIGN_STYLE'] = "Manual"
93
-
94
- config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Distribution"
95
- config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Distribution"
96
-
97
- if cert_type == "development"
98
- config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Development"
99
- config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Development"
100
- end
91
+ # puts "=====1 target name: #{target.name.to_s} bundle_id_map_key: #{bundle_id_map_key} provisioning_info: #{provisioning_info}"
101
92
 
102
- if !provisioning_info.nil?
103
- config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = provisioning_info["bundle_id"]
104
- config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = provisioning_info['profile_name']
105
- config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]'] = provisioning_info['profile_name']
106
-
93
+ if !provisioning_info.nil?
94
+ target.build_configurations.each do |config|
95
+ target_atts_obj[target.uuid] = target_atts_obj[target.uuid] || {}
96
+ target_atts_obj[target.uuid]['DevelopmentTeam'] = team_id_vaule
97
+ target_atts_obj[target.uuid]['ProvisioningStyle'] = "Manual"
98
+ config.build_settings['DEVELOPMENT_TEAM'] = team_id_vaule
99
+ config.build_settings['DEVELOPMENT_TEAM[sdk=iphoneos*]'] = team_id_vaule
100
+ config.build_settings['CODE_SIGN_STYLE'] = "Manual"
101
+
102
+ config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Distribution"
103
+ config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Distribution"
104
+
105
+ if cert_type == "development"
106
+ config.build_settings['CODE_SIGN_IDENTITY'] = "Apple Development"
107
+ config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = "Apple Development"
108
+ end
109
+
110
+ if !provisioning_info.nil?
111
+ config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = provisioning_info["bundle_id"]
112
+ config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = provisioning_info['profile_name']
113
+ config.build_settings['PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]'] = provisioning_info['profile_name']
114
+
115
+ end
107
116
  end
108
117
  end
118
+
109
119
 
110
120
  end
111
121
  new_project_obj.save
@@ -120,6 +130,11 @@ module Pindo
120
130
 
121
131
  project_obj.targets.each do |target|
122
132
 
133
+ if target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:framework]) || target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:dynamic_library]) ||
134
+ target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:static_library]) || target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:bundle])
135
+ next
136
+ end
137
+
123
138
  temp_entitlements_file = target.build_configurations.first.build_settings['CODE_SIGN_ENTITLEMENTS']
124
139
  if !temp_entitlements_file.nil? && !temp_entitlements_file.empty?
125
140
  entitlements_plist_path = File.join(new_project_dir, temp_entitlements_file)
@@ -127,27 +142,37 @@ module Pindo
127
142
  if !File.exist?(entitlements_plist_path)
128
143
  raise Informative, "Target: #{target.name.to_s} 找不到文件 #{entitlements_plist_path}"
129
144
  end
130
- end
131
145
 
132
- temp_info = target.build_configurations.first.build_settings['INFOPLIST_FILE']
133
- info_plist_path = File.join(new_project_dir, temp_info)
134
- if target.product_type.to_s.eql?("com.apple.product-type.application") && !File.exist?(info_plist_path)
135
- raise Informative, "Missing Target #{target.name.to_s} Info.plist!!! #{info_plist_path} Modify Info.plist Error !!!"
146
+ if !group_id.nil?
147
+ modify_entitlements_plist(entitlements_plist_path:entitlements_plist_path, group_id:group_id)
148
+ end
149
+
150
+ if target.product_type.to_s.eql?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) then
151
+ add_swark_entitlement(entitlements_plist_path:entitlements_plist_path, bundle_id_dict:provisioning_info_array)
152
+ if !icloud_id.nil?
153
+ modify_entitlements_plist(entitlements_plist_path:entitlements_plist_path, icloud_id:icloud_id)
154
+ end
155
+ end
156
+
136
157
  end
137
158
 
159
+ temp_info = target.build_configurations.first.build_settings['INFOPLIST_FILE']
160
+ if !temp_info.nil? && !temp_info.empty?
161
+ info_plist_path = File.join(new_project_dir, temp_info)
162
+ if !File.exist?(info_plist_path)
163
+ raise Informative, "Missing Target #{target.name.to_s} Info.plist!!! #{info_plist_path} Modify Info.plist Error !!!"
164
+ end
138
165
 
139
- if target.product_type.to_s.eql?("com.apple.product-type.application") then
140
- add_swark_entitlement(entitlements_plist_path:entitlements_plist_path, bundle_id_dict:provisioning_info_array)
141
- if !icloud_id.nil?
142
- modify_entitlements_plist(entitlements_plist_path:entitlements_plist_path, icloud_id:icloud_id)
143
- modify_info_plist_icloud(plist_file_name:info_plist_path, icloud_id:icloud_id)
144
- else
145
- modify_info_plist_icloud(plist_file_name:info_plist_path, icloud_id:nil)
166
+ if target.product_type.to_s.eql?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application]) then
167
+ if !icloud_id.nil?
168
+ modify_info_plist_icloud(plist_file_name:info_plist_path, icloud_id:icloud_id)
169
+ else
170
+ modify_info_plist_icloud(plist_file_name:info_plist_path, icloud_id:nil)
171
+ end
146
172
  end
173
+
147
174
  end
148
- if !group_id.nil?
149
- modify_entitlements_plist(entitlements_plist_path:entitlements_plist_path, group_id:group_id)
150
- end
175
+
151
176
  end
152
177
 
153
178
  end
@@ -36,7 +36,7 @@ module Pindo
36
36
  def login
37
37
  @pgyer_client = PgyerClient.new
38
38
  if @force_login || !@has_login
39
- @has_login = @pgyer_client.do_login(force_login:@force_login)
39
+ @has_login = @pgyer_client.do_login(force_login:@force_login)
40
40
  @force_login = false
41
41
  end
42
42
  return @has_login
@@ -50,7 +50,7 @@ module Pindo
50
50
  if !proj_name.nil?
51
51
  app_info_obj = PgyerHelper.share_instace.find_app_info_with_obj_list(proj_name:upload_proj_name)
52
52
  end
53
-
53
+
54
54
  if !app_info_obj.nil?
55
55
  return app_info_obj
56
56
  end
@@ -58,35 +58,35 @@ module Pindo
58
58
  proj_name_array = []
59
59
  if File.exist?(File.join(working_directory, "config.json"))
60
60
  config_json = JSON.parse(File.read(File.join(working_directory, "config.json")))
61
- proj_name_array << config_json["project_info"]["project_name"]
61
+ proj_name_array << config_json["project_info"]["project_name"]
62
62
  end
63
63
 
64
64
  xcodeproj_file_name = Dir.glob(File.join(Dir.pwd, "/*.xcodeproj")).max_by {|f| File.mtime(f)}
65
65
  upload_proj_name = File.basename(xcodeproj_file_name, ".xcodeproj") if xcodeproj_file_name
66
66
  if !upload_proj_name.nil? && !upload_proj_name.empty?
67
- proj_name_array << upload_proj_name
67
+ proj_name_array << upload_proj_name
68
68
  end
69
-
69
+
70
70
  puts
71
71
  dir_base_name = File.basename(working_directory)
72
72
  unless ["Desktop", "Documents", "Downloads"].include?(dir_base_name)
73
73
  proj_name_array << dir_base_name
74
74
  end
75
-
75
+
76
76
  proj_name_array << "自定义输入Pyger上的App代号"
77
77
 
78
78
  if proj_name_array.size > 1
79
79
  cli = HighLine.new
80
80
  upload_proj_name = cli.choose do |menu|
81
- menu.prompt = "请选择对应的Pgyer App代号:"
81
+ menu.prompt = "请选择Pgyer上的App代号:"
82
82
  menu.choices(*proj_name_array)
83
83
  end
84
84
  if upload_proj_name.include?("自定义输入")
85
- upload_proj_name = ask('请输入对应Pyger上的App代号(大小写空格忽略):') || nil
85
+ upload_proj_name = ask('请输入Pyger上的App代号(大小写空格忽略):') || nil
86
86
  upload_proj_name = upload_proj_name.strip
87
87
  end
88
88
  else
89
- upload_proj_name = ask('请输入对应Pyger上的App代号(大小写空格忽略):') || nil
89
+ upload_proj_name = ask('请输入Pyger上的App代号(大小写空格忽略):') || nil
90
90
  upload_proj_name = upload_proj_name.strip
91
91
  end
92
92
 
@@ -94,14 +94,16 @@ module Pindo
94
94
  app_info_obj = PgyerHelper.share_instace.find_app_info_with_obj_list(proj_name:upload_proj_name)
95
95
 
96
96
  if app_info_obj.nil?
97
- upload_proj_name = ask('请输入对应Pyger上的App代号(大小写空格忽略):') || nil
97
+ upload_proj_name = ask('没有找到结果,请重新输入Pyger上的App代号(大小写空格忽略):') || nil
98
98
  upload_proj_name = upload_proj_name.strip
99
99
  app_info_obj = PgyerHelper.share_instace.find_app_info_with_obj_list(proj_name:upload_proj_name)
100
100
  end
101
101
 
102
102
  if app_info_obj.nil?
103
- raise Informative, "#{upload_proj_name} 错误, 请输入正确的App代号, pgyer网站没有该App"
103
+ raise Informative, "#{upload_proj_name} 名称错误, 请输入正确的App代号,Pgyer网站没有该App!!!"
104
104
  end
105
+ else
106
+ raise Informative, "请先登录Pgyer网站"
105
107
  end
106
108
  app_info_obj
107
109
  end
@@ -112,13 +114,10 @@ module Pindo
112
114
  ipa_file_upload=File.join(args_ipa_file_dir, File.basename(ipa_file_upload))
113
115
 
114
116
  current_project_dir = Dir.pwd
115
- puts "current_project_dir : #{current_project_dir}"
116
- puts description
117
- puts File.exist?(File.join(current_project_dir, ".git"))
118
117
  if description.nil? && File.exist?(File.join(current_project_dir, ".git"))
119
118
  commit_id_info = git_latest_commit_id(local_repo_dir:current_project_dir)
120
119
  if commit_id_info
121
- description = "commit " + commit_id_info
120
+ description = "commit " + commit_id_info
122
121
  end
123
122
  end
124
123
 
@@ -264,7 +263,7 @@ module Pindo
264
263
  req.headers['Content-Type'] = 'application/json'
265
264
  req.body = body_data.to_json
266
265
  end
267
-
266
+
268
267
 
269
268
  body_data = {
270
269
  msgtype:"text",
@@ -387,7 +386,7 @@ module Pindo
387
386
  Funlog.instance.fancyinfo_error("拉取app信息列表失败!")
388
387
  raise Informative, "Pgyer网络数据异常!!!"
389
388
  end
390
-
389
+
391
390
 
392
391
  return app_info_list
393
392
  end
@@ -424,7 +423,7 @@ module Pindo
424
423
  app_incId_index = ask('请选择上面的Build号:')
425
424
 
426
425
  end
427
-
426
+
428
427
  Funlog.instance.fancyinfo_success("拉取app上传记录完成!")
429
428
 
430
429
  version_item_obj = nil
@@ -508,7 +507,7 @@ module Pindo
508
507
  return true
509
508
  else
510
509
  Funlog.instance.fancyinfo_error("重签名失败!")
511
- return false
510
+ return false
512
511
  end
513
512
 
514
513
  end
@@ -109,7 +109,7 @@ module Pindo
109
109
  def get_xcodeproj_imessage_icon_path
110
110
  icon_path = nil
111
111
  select_target = @project_obj.targets.select { |target| target.product_type.include?(Xcodeproj::Constants::PRODUCT_TYPE_UTI[:messages_extension]) }.first
112
- if select_target.nil?
112
+ if !select_target.nil?
113
113
  file_ref = select_target.resources_build_phase.files_references.select { |file| file.display_name.include?("Assets.xcassets") }.first
114
114
  icon_path = File.join(file_ref.real_path,"iMessage App Icon.stickersiconset")
115
115
  end
@@ -63,7 +63,7 @@ module Pindo
63
63
  'sips',
64
64
  '--matchTo', '/System/Library/ColorSync/Profiles/sRGB Profile.icc',
65
65
  '-z', width.to_s, height.to_s,
66
- icon_name,
66
+ icon_ori_name,
67
67
  '--out', File.join(new_icon_dir, image_name)
68
68
  ]
69
69
  Executable.capture_command('sips', command, capture: :out)
@@ -83,7 +83,6 @@ module Pindo
83
83
  create_icon(icon_name: icon_name, new_icon_dir: new_icon_dir, xcode_icon_json: XcodoeResConst.xcode_ios_icon_json)
84
84
  icon_dir = File.dirname(icon_name)
85
85
  imessage_icon = File.join(icon_dir, "icon1024_768.png")
86
-
87
86
  new_imessage_icon_dir = File.join(new_icon_dir, "imessage")
88
87
 
89
88
  if File.exist?(imessage_icon)
@@ -92,7 +91,7 @@ module Pindo
92
91
  rescue => e
93
92
  puts e
94
93
  end
95
- create_imessage_icon(icon_name: imessage_icon, image_icon_name:imessage_icon, new_icon_dir: new_imessage_icon_dir, xcode_icon_json: XcodoeResConst.xcode_ios_imessage_icon_json)
94
+ create_imessage_icon(icon_name: icon_name, image_icon_name:imessage_icon, new_icon_dir: new_imessage_icon_dir, xcode_icon_json: XcodoeResConst.xcode_ios_imessage_icon_json)
96
95
  end
97
96
  end
98
97
 
@@ -105,7 +105,6 @@ module Pindo
105
105
 
106
106
  def validate!
107
107
  super
108
-
109
108
  if !@args_appconfig.empty? && File::file?(@args_appconfig)
110
109
  @args_appconfig_dir=File::expand_path(File::dirname(@args_appconfig))
111
110
  @args_appconfig_fullname=File::join(@args_appconfig_dir, File::basename(@args_appconfig))
@@ -274,7 +273,7 @@ module Pindo
274
273
 
275
274
  unless @args_bundle_id.nil?
276
275
  @bundle_id = @args_bundle_id.nil? ? @deploy_identifier : @args_bundle_id
277
- @group_id = @deploy_group_id.nil? ? @deploy_group_idnil : ("group." + @bundle_id)
276
+ @group_id = @deploy_group_id.nil? ? @deploy_group_id : ("group." + @bundle_id)
278
277
  @icloud_id = @deploy_icloud_id.nil? ? @deploy_icloud_id : ("iCloud." + @bundle_id)
279
278
  @bundle_id_pushcontent = @deploy_identifier_pushcontent.nil? ? @deploy_identifier_pushcontent : (@bundle_id+".content")
280
279
  @bundle_id_pushservice = @deploy_identifier_pushservice.nil? ? @deploy_identifier_pushservice : (@bundle_id+".service")
data/lib/pindo/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Pindo
2
2
 
3
- VERSION = "4.7.0"
3
+ VERSION = "4.7.1"
4
4
 
5
5
  class VersionCheck
6
6
 
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.7.0
4
+ version: 4.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-26 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -280,6 +280,7 @@ files:
280
280
  - lib/pindo/command/dev.rb
281
281
  - lib/pindo/command/dev/autobuild.rb
282
282
  - lib/pindo/command/dev/autoresign.rb
283
+ - lib/pindo/command/dev/build.rb
283
284
  - lib/pindo/command/dev/confusecode.rb
284
285
  - lib/pindo/command/dev/confuseproj.rb
285
286
  - lib/pindo/command/dev/createbuild.rb