fastlane-plugin-zhuixi_build_app 1.1.6 → 1.1.8

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: 2a786dd65817d36b83f169b33f472a9bdac63ec885089d589d08340fbd2466f8
4
- data.tar.gz: ba724d3d1e71d302f95215f9d83931b41f6a250c04e39aac49ac7637aeb64b94
3
+ metadata.gz: fad17718d37d5da627587c4f30db77319e462e117c4d7b6adda774f968a1a155
4
+ data.tar.gz: aca9ce718068c91998b268dc0492f184b4fbe5cdd42baae3e963b836d1ce4bd2
5
5
  SHA512:
6
- metadata.gz: 1c3b280d54cec8742a626a78a10e52738bd023368109734054281372477ce3b51c7965461aebef303b24ac595bbc328742f6a3edfe4805493f18c210d6485adc
7
- data.tar.gz: 460e93533173ec11e9dce116543fd872c8d8cf4a4ecb8fc57f76318669d04135d5c1888fa555d649aaa24ba475b7a31551ddb3b3812c4c4a0852f331e5f481a2
6
+ metadata.gz: aa066d37d2be2e5b9c077d693b093463f99c66e9e0b678d4a34b9a24923a3c25e5184d148eb069499c61f0d59297f92fd9072fc2358c7832d152070fd5778aca
7
+ data.tar.gz: 18a1d97b4b6ac191f791a73a9f41e90c22cf03ab705b5579b60e743d1e4ee8b4bb62d837b8a80e56130ee3094094f27f3547bdf29da550d044cd6e7b8b134ce5
@@ -20,20 +20,23 @@ module Fastlane
20
20
  "platform_id" => lane_context[:platform_id],
21
21
  "game_id" => game_id,
22
22
  })
23
-
24
23
  response = Net::HTTP.start(uri.hostname, uri.port) do |http|
24
+ puts request.body
25
25
  http.request(request)
26
26
  end
27
27
 
28
28
  if response.code == "200"
29
29
  result = JSON.parse(response.body)
30
- puts result
31
30
  if result["code"] == 200
32
31
  data = result["data"]
33
32
  lane_context[:configParams] = data["config"]
34
33
  resourcesUrl = data["resources_url"]
35
34
  return resourcesUrl.to_s
35
+ else
36
+ puts "获取打包配置失败:\n#{result}"
36
37
  end
38
+ else
39
+ puts "获取打包配置失败:HTTP\n #{response}"
37
40
  end
38
41
  end
39
42
 
@@ -210,42 +210,52 @@ module Fastlane
210
210
  File.open(vconfig_json, "w") do |f|
211
211
  f.puts JSON.pretty_generate(json)
212
212
  end
213
+ elsif lane_context[:selectPlatformName] == "奇界"
214
+ other_action.update_plist(
215
+ plist_path: lane_context[:zhuixi_path] + "/resources/SDKs/BRSDK.plist",
216
+ block: proc do |plist|
217
+ plist["direction"] = lane_context[:configParams][:channel_orientation.to_s] == "landscape" ? "2" : "1"
218
+ end,
219
+ )
220
+ elsif lane_context[:selectPlatformName] == "527"
221
+ other_action.update_plist(
222
+ plist_path: lane_context[:zhuixi_path] + "/resources/SDKs/QnAggSdkRes.bundle/Params.plist",
223
+ block: proc do |plist|
224
+ plist["appID"] = lane_context[:configParams][:channel_appid.to_s]
225
+ plist["appKey"] = lane_context[:configParams][:channel_appkey.to_s]
226
+ end,
227
+ )
213
228
  end
214
229
  end
215
-
216
230
  # 是否在动态库集合
217
231
  def self.isEmbedFramework(filename)
218
232
  framework_path = filename.to_s
219
233
  framework_name = File.basename(framework_path, ".*") # 提取 .framework 文件的名称
220
- platform_id = [59, 61, 62]
221
- if platform_id.include?(lane_context[:platform_id])
222
- # .framework 目录中搜索与文件名相同的文件
223
- file_path = Dir.glob("#{framework_path}/#{framework_name}").first
224
-
225
- if file_path.nil?
226
- UI.error("File not found for #{framework_name}.")
227
- return false
228
- end
234
+ # .framework 目录中搜索与文件名相同的文件
235
+ file_path = Dir.glob("#{framework_path}/#{framework_name}").first
236
+ if file_path.nil?
237
+ UI.error("File not found for #{framework_name}.")
238
+ return false
239
+ end
229
240
 
230
- # 使用 file 命令查看文件类型
231
- file_output = sh("file #{file_path}")
241
+ # 使用 file 命令查看文件类型
242
+ file_output = sh("file #{file_path}")
232
243
 
233
- # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
234
- is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
244
+ # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
245
+ is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
235
246
 
236
- if is_dynamic_library
237
- # 文件是动态库
238
- # 执行相应的操作
239
- # ...
240
- puts "文件是动态库 #{framework_name}"
241
- return true
242
- else
243
- # 文件是静态库
244
- # 执行其他操作
245
- # ...
246
- puts "文件是静态库 #{framework_name}"
247
- return false
248
- end
247
+ if is_dynamic_library
248
+ # 文件是动态库
249
+ # 执行相应的操作
250
+ # ...
251
+ puts "文件是动态库 #{framework_name}"
252
+ return true
253
+ else
254
+ # 文件是静态库
255
+ # 执行其他操作
256
+ # ...
257
+ puts "文件是静态库 #{framework_name}"
258
+ return false
249
259
  end
250
260
  return false
251
261
  end
@@ -310,20 +320,30 @@ module Fastlane
310
320
  #项目中可能有多个copy files build phases,找到刚刚创建的那个,然后把xx.framework引入
311
321
 
312
322
  if !"".eql? lib_real_path and isEmbedFramework(filename)
313
- lane_context[:target].copy_files_build_phases.each do |item|
314
- if item.name == "Embed Frameworks"
315
- #引入xx.framework
316
- item.add_file_reference(file_ref)
317
- #设置copy file buldphase中的Destination选项,使用枚举值表示的。"10"表示Frameworks
318
- #这个值我是通过对比设置前后的两个文件找出来的
319
- item.dst_subfolder_spec = "10"
320
- #勾上code sign on copy选项(默认是没勾上的)
321
- item.files.each do |e|
322
- e.settings = Hash.new
323
- e.settings["ATTRIBUTES"] = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
323
+ has_embed_frameworks = false
324
+ lane_context[:target].copy_files_build_phases.each do |phase|
325
+ if phase.name == "Embed Frameworks"
326
+ has_embed_frameworks = true
327
+
328
+ phase.add_file_reference(file_ref)
329
+ phase.dst_subfolder_spec = "10"
330
+
331
+ phase.files.each do |file|
332
+ file.settings = { "ATTRIBUTES" => ["CodeSignOnCopy", "RemoveHeadersOnCopy"] }
324
333
  end
325
334
  end
326
335
  end
336
+
337
+ unless has_embed_frameworks
338
+ embed_phase = lane_context[:target].new_copy_files_build_phase("Embed Frameworks")
339
+ embed_phase.dst_subfolder_spec = "10"
340
+
341
+ embed_phase.add_file_reference(file_ref)
342
+
343
+ embed_phase.files.each do |file|
344
+ file.settings = { "ATTRIBUTES" => ["CodeSignOnCopy", "RemoveHeadersOnCopy"] }
345
+ end
346
+ end
327
347
  end
328
348
  lane_context[:target].frameworks_build_phase.add_file_reference(file_ref, true)
329
349
  elsif filename.to_s.end_with?(".plist", ".bundle", ".png", ".storyboard", ".json")
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ZhuixiBuildApp
3
- VERSION = "1.1.6"
3
+ VERSION = "1.1.8"
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.1.6
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedSevenMale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-21 00:00:00.000000000 Z
11
+ date: 2023-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler