cocoapods-bb-xcframework 0.2.6.3 → 0.2.6.5

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: be757b65dcad2eee788c536a5546173235e0763e8e55df3a935811554de77afd
4
- data.tar.gz: 485a105ead0d091f645b49ad59a0da64afe3d4510ab2654e4215dfbb007fb7ca
3
+ metadata.gz: 1a83d3846da44025ba26e03b0953dbb3d040ea22ea08a845ab3709b1abc221bc
4
+ data.tar.gz: 7d74a47b3749e010bb1a9c0415f7fd1985e8c5c2bb9d3318e37b9f34b36383e8
5
5
  SHA512:
6
- metadata.gz: 161d22ffdf76f7af4753ebdbd8866b54c754855700d4b833b38cf80495690e98a18482e55bf1abca9ffaa99631279fe91cc581a9cc1cfac06d8d66b4250563d5
7
- data.tar.gz: b65ef5e847ace4cb2ac17d9e1c52c4e61fc8a839758aa839e1e4a019b109c64e8bc9687beacb07c606ba8fd26be007b93cb1c3714004875e4207fc60ca37102d
6
+ metadata.gz: e9c77d4c42bdcb027d279915f678411b320598983b57c955dc47cd6af915e359484ab174b5748c0226f85e19fc974779b2ead6a10ef5847a85249705ae785edf
7
+ data.tar.gz: 95605f64168e45a6fcb68337176bc7879aba2b70b8461dab47c392cd23c45a72aef1045090791a47077a4d59dc429bfb8148d90fa1f7f909520f2ddc110e464d
@@ -19,7 +19,7 @@ module Pod
19
19
 
20
20
  def run
21
21
  spec = spec_with_path @name
22
- UI.warn "正在生成XCFramework #{spec.name}(#{spec.version})"
22
+ UI.puts "正在生成XCFramework #{spec.name}(#{spec.version})".yellow
23
23
  @is_spec_from_path = true if spec
24
24
  spec ||= spec_with_name @name
25
25
 
@@ -1,3 +1,3 @@
1
1
  module CocoapodsXCFramework
2
- VERSION = "0.2.6.3"
2
+ VERSION = "0.2.6.5"
3
3
  end
@@ -301,6 +301,29 @@ module Pod
301
301
  end
302
302
  end
303
303
  end
304
+ puts "fix_header_file".yellow
305
+ puts spec_hash.to_json
306
+ spec_hash
307
+ end
308
+
309
+ # 脚本不会针对podspec中配置resources、resource_bundles动态生成bundle,故手动进行bundle路径修复
310
+ def fix_bundle_file(origin_spec, spec_hash, project_dir, xcframework_path)
311
+ puts "fix_bundle_file".yellow
312
+ origin_spec_hash = origin_spec.to_hash
313
+ res_bundle=origin_spec_hash["resource_bundles"]
314
+ if res_bundle
315
+ puts "二进制库不支持动态生成bundle文件,请手动存放bundle文件 参照:s.resources = 'xx.bundle' ".red
316
+ raise "#{res_bundle}"
317
+ end
318
+ res_bundle=origin_spec_hash["resources"]
319
+ if res_bundle
320
+ puts "s.resources:#{res_bundle}"
321
+ bundle_path="#{project_dir}/#{res_bundle}"
322
+ FileUtils.cp_r(bundle_path,xcframework_path)
323
+ xcframework_comp = File.basename(xcframework_path)
324
+ bundle_comp = File.basename(res_bundle)
325
+ spec_hash["resources"] = "#{xcframework_comp}/#{bundle_comp}" # bundle资源存放规则,xcframework根目录
326
+ end
304
327
  puts spec_hash.to_json
305
328
  spec_hash
306
329
  end
@@ -71,12 +71,39 @@ module Pod
71
71
  else
72
72
  command = "xcodebuild #{defines} BUILD_DIR=#{build_dir} BUILD_LIBRARY_FOR_DISTRIBUTION=YES clean build -configuration #{configuration} -alltargets -destination '#{destination}' ARCHS='#{archs}' SKIP_INSTALL=#{skip_install} | xcpretty 2>&1"
73
73
  end
74
- UI.puts("XBuilder command:#{command}")
75
- output = `#{command}`.lines.to_a
76
- Dir.chdir pwd
77
- if $?.exitstatus != 0
78
- Pod::ErrorUtil.error_report command,output
79
- Process.exit -1
74
+ # UI.puts("XBuilder command:#{command}")
75
+ # output = `#{command}`.lines.to_a
76
+ # Dir.chdir pwd
77
+ # if $?.exitstatus != 0
78
+ # Pod::ErrorUtil.error_report command,output
79
+ # Process.exit -1
80
+ # end
81
+
82
+ # --- enhanced logging & reliable failure surfacing ---
83
+ log_dir = File.join(work_dir, 'logs')
84
+ FileUtils.mkdir_p(log_dir)
85
+ scheme_name = (scheme || @spec&.name || 'Pods').to_s
86
+ plat_name = platform.to_s.gsub(/\s+/, '_')
87
+ log_raw = File.join(log_dir, "xcodebuild-#{scheme_name}-#{plat_name}-#{configuration}.raw.log")
88
+
89
+ # Allow disabling xcpretty via env
90
+ use_pretty = ENV['XBUILDER_NOPRETTY'] != '1'
91
+ wrapped = if use_pretty
92
+ "set -o pipefail; #{command} | tee '#{log_raw}' | xcpretty"
93
+ else
94
+ # no pretty: just tee to log and console
95
+ "set -o pipefail; #{command} | tee '#{log_raw}'"
96
+ end
97
+ UI.puts "XBuilder command: #{command}"
98
+ success = system('bash', '-lc', wrapped)
99
+ unless success
100
+ UI.puts "\n** xcodebuild failed — showing last 200 lines of raw log: #{log_raw}".red
101
+ if File.exist?(log_raw)
102
+ tail = `tail -n 200 '#{log_raw}'`
103
+ UI.puts tail
104
+ end
105
+ Pod::ErrorUtil.error_report(command, []) if defined?(Pod::ErrorUtil)
106
+ Process.exit $?.exitstatus.nonzero? || 1
80
107
  end
81
108
  end
82
109
  end
@@ -183,7 +183,9 @@ module Pod
183
183
  outputs_bundle target_dir
184
184
  new_spec_hash = generic_new_podspec_hash @spec
185
185
  new_spec_hash[:vendored_frameworks] = "#{@spec.name}.xcframework"
186
- new_spec_hash = fix_header_file new_spec_hash, "#{target_dir}/#{@spec.name}.xcframework"
186
+ xcframework_path = "#{target_dir}/#{@spec.name}.xcframework"
187
+ new_spec_hash = fix_header_file new_spec_hash, xcframework_path
188
+ new_spec_hash = fix_bundle_file(@spec, new_spec_hash, @source_dir, xcframework_path)
187
189
  find_bundles(target_dir).each do |plat, value|
188
190
  if new_spec_hash[plat]
189
191
  new_spec_hash[plat]["resource_bundles"] = value
@@ -202,7 +204,7 @@ module Pod
202
204
  UI.puts "fix xcframework-is-not-a-member-type-of-error:#{target_dir}"
203
205
  fix_xcframework_error(target_dir, @spec.name)
204
206
 
205
- UI.puts "result export at :#{target_dir}"
207
+ UI.puts "result export at :#{target_dir} 生成成功".green
206
208
  target_dir
207
209
  end
208
210
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-xcframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6.3
4
+ version: 0.2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: cocoapods
@@ -91,7 +90,6 @@ homepage: https://github.com/humin1102/cocoapods-bb-xcframework
91
90
  licenses:
92
91
  - MIT
93
92
  metadata: {}
94
- post_install_message:
95
93
  rdoc_options: []
96
94
  require_paths:
97
95
  - lib
@@ -106,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
104
  - !ruby/object:Gem::Version
107
105
  version: '0'
108
106
  requirements: []
109
- rubygems_version: 3.4.16
110
- signing_key:
107
+ rubygems_version: 3.7.2
111
108
  specification_version: 4
112
109
  summary: 把podspec打包成xcframework的小工具。packager pod to a xcframework
113
110
  test_files: