fastlane-plugin-zhuixi_build_app 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a786dd65817d36b83f169b33f472a9bdac63ec885089d589d08340fbd2466f8
4
- data.tar.gz: ba724d3d1e71d302f95215f9d83931b41f6a250c04e39aac49ac7637aeb64b94
3
+ metadata.gz: f6ef53eff8b21ea36866a0e6aa61ad4c0d27eb9b8708facf7c16b50a253f2662
4
+ data.tar.gz: b6aca2fd9d0c0b9cf82ada3d92f83c4681d0a8343fa491610eb3a19336aa8ecd
5
5
  SHA512:
6
- metadata.gz: 1c3b280d54cec8742a626a78a10e52738bd023368109734054281372477ce3b51c7965461aebef303b24ac595bbc328742f6a3edfe4805493f18c210d6485adc
7
- data.tar.gz: 460e93533173ec11e9dce116543fd872c8d8cf4a4ecb8fc57f76318669d04135d5c1888fa555d649aaa24ba475b7a31551ddb3b3812c4c4a0852f331e5f481a2
6
+ metadata.gz: d093def896b1aebfaa9e3f6d48aa2f1b478de949938efbd5e3e2603b7b8b667e8325d8db6c13703b3a3fb775f19765bb825e49deed6183350979a58ecc89c061
7
+ data.tar.gz: '084abf57a1139ede8e608ac8e9b6b7bc916690fe5a76a5379b79120a6f1abb0c03608281cfb89ebd1b55bc37771d8cf3554c14d07e6e3f777b6b835f1961f336'
@@ -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,44 @@ 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
+ )
213
220
  end
214
221
  end
215
-
216
222
  # 是否在动态库集合
217
223
  def self.isEmbedFramework(filename)
218
224
  framework_path = filename.to_s
219
225
  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
226
+ # .framework 目录中搜索与文件名相同的文件
227
+ file_path = Dir.glob("#{framework_path}/#{framework_name}").first
228
+ if file_path.nil?
229
+ UI.error("File not found for #{framework_name}.")
230
+ return false
231
+ end
229
232
 
230
- # 使用 file 命令查看文件类型
231
- file_output = sh("file #{file_path}")
233
+ # 使用 file 命令查看文件类型
234
+ file_output = sh("file #{file_path}")
232
235
 
233
- # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
234
- is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
236
+ # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
237
+ is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
235
238
 
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
239
+ if is_dynamic_library
240
+ # 文件是动态库
241
+ # 执行相应的操作
242
+ # ...
243
+ puts "文件是动态库 #{framework_name}"
244
+ return true
245
+ else
246
+ # 文件是静态库
247
+ # 执行其他操作
248
+ # ...
249
+ puts "文件是静态库 #{framework_name}"
250
+ return false
249
251
  end
250
252
  return false
251
253
  end
@@ -310,20 +312,30 @@ module Fastlane
310
312
  #项目中可能有多个copy files build phases,找到刚刚创建的那个,然后把xx.framework引入
311
313
 
312
314
  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"]
315
+ has_embed_frameworks = false
316
+ lane_context[:target].copy_files_build_phases.each do |phase|
317
+ if phase.name == "Embed Frameworks"
318
+ has_embed_frameworks = true
319
+
320
+ phase.add_file_reference(file_ref)
321
+ phase.dst_subfolder_spec = "10"
322
+
323
+ phase.files.each do |file|
324
+ file.settings = { "ATTRIBUTES" => ["CodeSignOnCopy", "RemoveHeadersOnCopy"] }
324
325
  end
325
326
  end
326
327
  end
328
+
329
+ unless has_embed_frameworks
330
+ embed_phase = lane_context[:target].new_copy_files_build_phase("Embed Frameworks")
331
+ embed_phase.dst_subfolder_spec = "10"
332
+
333
+ embed_phase.add_file_reference(file_ref)
334
+
335
+ embed_phase.files.each do |file|
336
+ file.settings = { "ATTRIBUTES" => ["CodeSignOnCopy", "RemoveHeadersOnCopy"] }
337
+ end
338
+ end
327
339
  end
328
340
  lane_context[:target].frameworks_build_phase.add_file_reference(file_ref, true)
329
341
  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.7"
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.7
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-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler