fastlane-plugin-zhuixi_build_app 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fe2a794f18890b8fee8f284b2f82f6be269c081344d7b8a9dbefcca4f972a78
4
- data.tar.gz: f0f5896d4e538b9ddf31b65eea1af660c85c59b89196ecbcdbaaf272eff48f3e
3
+ metadata.gz: 1ed82fabd117eb842bdfcbfb1418d0d418799c10227e34f9ca92f60471fc9ee2
4
+ data.tar.gz: f2a9685986d37b8b21f4cc23fa6d05d07ae76dc646bb6fa0c266ec7a7947265b
5
5
  SHA512:
6
- metadata.gz: 2daaf3a7c685c50e2ed8cbb08c74f15fe399a732dfb63e119c8af5ef36f3c00e31927a9fb06fac2d8b115b3dd790bb69bf81f4cb3ee1949220f20fb891443e7b
7
- data.tar.gz: 79507ad983ab650ae583dc1f4f93cc2d6e5d1f3813fb43a6df9261bf63dfc3fa9406b0d81ebc81456e332acc18525de380162727e4ca1af3c07a5c075727b920
6
+ metadata.gz: 0a05523cfe5087b00e9ef4adfa747f423820dde113cacbedb09d714b94c4193f9506fdbb0cd9cd6b3913023c67c5ef0bc82fd55e19bcc05eaa3c53f63215f5b7
7
+ data.tar.gz: 071d3dff11119c500f50cc149769bcc6adb981074273d23520f49b04fafbe15873609924bfa44c6f7b30da62c4324468c4d20f28f91bc0a6c5e862585e154e88
@@ -15,6 +15,8 @@ module Fastlane
15
15
  lane_context[:selectGameName] = app_file_config[:selectGameName]
16
16
  lane_context[:selectPlatformName] = app_file_config[:platform]
17
17
  lane_context[:ori_xcodeproj_path] = app_file_config[:ori_xcodeproj_path]
18
+ lane_context[:export_method] = app_file_config[:export_method]
19
+ lane_context[:provisioning_profile_name] = app_file_config[:provisioning_profile_name]
18
20
  UI.message("ZHUIXI---读取配置成功!app_file_path:\n#{app_file_path}")
19
21
  # 返回 account 和 password
20
22
  return { account: account, password: password }
@@ -108,7 +108,9 @@ module Fastlane
108
108
 
109
109
  # 如果 info_plist_data 没有 LSApplicationQueriesSchemes 配置,先创建一个空数组
110
110
  info_plist_data["LSApplicationQueriesSchemes"] ||= []
111
-
111
+ # 修改 Bundle Identifier 和 Display Name
112
+ info_plist_data["CFBundleIdentifier"] = lane_context[:configParams]["gamePackageName"]
113
+ info_plist_data["CFBundleDisplayName"] = lane_context[:configParams]["gamename"]
112
114
  # 3. 读取 TempInfo.plist 文件
113
115
  temp_info_plist_data = Plist.parse_xml(File.join(lane_context[:zhuixi_path], "TempInfo.plist"))
114
116
 
@@ -160,21 +162,39 @@ module Fastlane
160
162
  add_channel_sdk_library()
161
163
  end
162
164
  # 是否在动态库集合
163
- def self.isEmbedFramework(filename, setting)
164
- embedArc = ["boRanSDK.framework", "NyBugly.framework", "XHYSDK.framework"]
165
+ def self.isEmbedFramework(filename)
166
+ framework_path = filename.to_s
167
+ framework_name = File.basename(framework_path, ".*") # 提取 .framework 文件的名称
168
+ if lane_context[:platform_id] == 59 && framework_name == "boRanSDK"
169
+ # 在 .framework 目录中搜索与文件名相同的文件
170
+ file_path = Dir.glob("#{framework_path}/#{framework_name}").first
171
+
172
+ if file_path.nil?
173
+ UI.error("File not found for #{framework_name}.")
174
+ return false
175
+ end
165
176
 
166
- if !setting
167
- temp_name = filename.to_s
168
- else
169
- temp_name = filename.display_name
170
- end
171
- if !setting and temp_name.end_with?(embedArc[0], embedArc[1], embedArc[2])
172
- return true
173
- elsif setting and embedArc.include?(temp_name)
174
- return true
175
- else
176
- return false
177
+ # 使用 file 命令查看文件类型
178
+ file_output = sh("file #{file_path}")
179
+
180
+ # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
181
+ is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
182
+
183
+ if is_dynamic_library
184
+ # 文件是动态库
185
+ # 执行相应的操作
186
+ # ...
187
+ puts "文件是动态库 #{framework_name}"
188
+ return true
189
+ else
190
+ # 文件是静态库
191
+ # 执行其他操作
192
+ # ...
193
+ puts "文件是静态库 #{framework_name}"
194
+ return false
195
+ end
177
196
  end
197
+ return false
178
198
  end
179
199
 
180
200
  def self.add_channel_sdk_library()
@@ -235,7 +255,7 @@ module Fastlane
235
255
  end
236
256
  #项目中可能有多个copy files build phases,找到刚刚创建的那个,然后把xx.framework引入
237
257
 
238
- if !"".eql? lib_real_path and isEmbedFramework(filename, false)
258
+ if !"".eql? lib_real_path and isEmbedFramework(filename)
239
259
  lane_context[:target].copy_files_build_phases.each do |item|
240
260
  if item.name == "Embed Frameworks"
241
261
  #引入xx.framework
@@ -245,10 +265,8 @@ module Fastlane
245
265
  item.dst_subfolder_spec = "10"
246
266
  #勾上code sign on copy选项(默认是没勾上的)
247
267
  item.files.each do |e|
248
- if isEmbedFramework(e, true)
249
- e.settings = Hash.new
250
- e.settings["ATTRIBUTES"] = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
251
- end
268
+ e.settings = Hash.new
269
+ e.settings["ATTRIBUTES"] = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
252
270
  end
253
271
  end
254
272
  end
@@ -303,22 +321,33 @@ module Fastlane
303
321
  schemefile = File.basename(new_schemefilepath, ".xcscheme")
304
322
  end
305
323
  end
306
- lane_context[:project].save()
324
+ # lane_context[:project].save()
307
325
  # Find.find(File.join(lane_context[:cha_project_path], "xcuserdata")) do |schemefilepath|
308
326
  # if schemefilepath.include? ".xcscheme"
309
327
  # schemefile = schemefilepath
310
328
  # end
311
329
  # end
312
-
313
330
  # 执行 fastlane gym
331
+ # other_action.update_plist( # Updates the CLIENT_ID and GOOGLE_APP_ID string entries in the plist-file
332
+ # plist_path: File.join(lane_context[:zhuixi_path], "Info.plist"),
333
+ # block: proc do |plist|
334
+ # plist["CFBundleDisplayName"] = lane_context[:configParams]["gamename"]
335
+ # plist["CFBundleIdentifier"] = lane_context[:configParams]["gamePackageName"]
336
+ # end,
337
+ # )
338
+ lane_context[:project].save()
314
339
  puts lane_context[:configParams]
315
340
  timestamp = Time.now.strftime("%Y%m%d%H%M%S")
316
341
  output_name = lane_context[:configParams]["gamename"] + "_" + lane_context[:platform_id].to_s + "_" + lane_context[:selectPlatformName] + "_" + timestamp
317
342
  other_action.gym(
318
343
  project: lane_context[:cha_project_path],
319
- silent: true,
320
344
  output_name: output_name,
321
- include_symbols: false,
345
+ export_method: lane_context[:export_method],
346
+ export_options: {
347
+ provisioningProfiles: {
348
+ lane_context[:configParams]["gamePackageName"] => lane_context[:provisioning_profile_name],
349
+ },
350
+ },
322
351
  )
323
352
  end
324
353
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ZhuixiBuildApp
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-zhuixi_build_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedSevenMale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -169,7 +169,7 @@ files:
169
169
  - lib/fastlane/plugin/zhuixi_build_app/actions/zhuixi_build_app_action.rb
170
170
  - lib/fastlane/plugin/zhuixi_build_app/helper/zhuixi_build_app_helper.rb
171
171
  - lib/fastlane/plugin/zhuixi_build_app/version.rb
172
- homepage:
172
+ homepage: https://github.com/RedSevenMale/fastlane-plugin-zhuixi_build_app
173
173
  licenses:
174
174
  - MIT
175
175
  metadata: {}