cocoapods-binary-matchup 0.0.17 → 0.0.18

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: 5b2d7e5383e4069928a8652aef16cd19446482e0149cb36dc4b880f68ffdd11d
4
- data.tar.gz: b76423c11f50d5cba8f78c31c3707707aaf55511ef848225dfff0549ddb7c1c0
3
+ metadata.gz: 5ac1c4bb4db1b5e437ef1c6841de704d12e459b3f0e494af29d7f07421b6e33e
4
+ data.tar.gz: 6595cd815f89314d970ffdf1bfb8824b60b224c824b04d178643779984104ea3
5
5
  SHA512:
6
- metadata.gz: a2f3f6d35e6aa9a410038014c97a5c4fddbac788da44ce2b2fce2fb72d55c04cf910794d5ee7718274f5d6d80ba47095abf870096c22fcda52707be5058d044e
7
- data.tar.gz: fa74552e79a659791add383487f55fad19c492588fc5943f108cfff70fee9a98b1624e209c7bdb2c915b3dc800b8ec16773498a8fabf693f4cf5bef2673ecf13
6
+ metadata.gz: 80703fab252ab28abffb9b0932537add7c95e34d41ec042cc691e13224e4271d181a19dce9d0f88b75ff98fa832fafc32ad466234f17574f6dbd2d2e66c8c183
7
+ data.tar.gz: e5af0a07901d1a067e1e977a03daea4aecea122e7555c0516c82d1b733e3e7cd690890e14dd6c4ccdcf7005a2e95b7e2a87eac9102f95fc72b617f39895f7cba
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBinary
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -123,10 +123,107 @@ def build_for_iosish_platform(sandbox,
123
123
 
124
124
  # output
125
125
  output_path.mkpath unless output_path.exist?
126
+
127
+ # 🔑 添加资源处理 - 修复 iOS 14 资源丢失问题
128
+ copy_resources_to_framework(sandbox, target, device_framework_path)
129
+
126
130
  FileUtils.mv device_framework_path, output_path, :force => true
127
131
 
128
132
  end
129
133
 
134
+ # 新增函数:拷贝资源文件到 framework
135
+ def copy_resources_to_framework(sandbox, target, framework_path)
136
+ Pod::UI.puts "📋 Processing resources for #{target.name}..."
137
+
138
+ # 获取 target 的资源文件
139
+ pod_target = target
140
+ consumer = pod_target.root_spec.consumer(pod_target.platform.name)
141
+ file_accessor = Pod::Sandbox::FileAccessor.new(sandbox.pod_dir(pod_target.pod_name), consumer)
142
+
143
+ # 1. 处理 resource_bundles(使用正确的 API)
144
+ resource_bundles = consumer.resource_bundles
145
+ unless resource_bundles.empty?
146
+ Pod::UI.puts " 📦 Processing #{resource_bundles.count} resource bundles"
147
+ resource_bundles.each do |bundle_name, bundle_files|
148
+ bundle_path = Pathname(framework_path).dirname + "#{bundle_name}.bundle"
149
+ if bundle_path.exist?
150
+ Pod::UI.puts " 📦 Found resource bundle: #{bundle_name}.bundle"
151
+ end
152
+ end
153
+ end
154
+
155
+ # 2. 处理普通资源文件
156
+ unless file_accessor.resources.empty?
157
+ Pod::UI.puts " 📄 Processing #{file_accessor.resources.count} resource files"
158
+ file_accessor.resources.each do |resource_file|
159
+ if File.exist?(resource_file)
160
+ # 确定目标路径
161
+ relative_path = resource_file.relative_path_from(sandbox.pod_dir(pod_target.pod_name))
162
+ target_path = Pathname(framework_path) + relative_path.basename
163
+
164
+ # 拷贝资源文件
165
+ FileUtils.cp_r(resource_file, target_path, :remove_destination => true)
166
+ Pod::UI.puts " 📄 Copied resource: #{relative_path.basename}"
167
+ end
168
+ end
169
+ end
170
+
171
+ # 3. 特别处理 Assets.xcassets (iOS 14 兼容性)
172
+ assets_paths = file_accessor.resources.select { |path| path.extname == '.xcassets' }
173
+ unless assets_paths.empty?
174
+ Pod::UI.puts " 🎨 Processing #{assets_paths.count} Assets.xcassets for iOS 14 compatibility"
175
+ assets_paths.each do |assets_path|
176
+ relative_path = assets_path.relative_path_from(sandbox.pod_dir(pod_target.pod_name))
177
+ target_path = Pathname(framework_path) + relative_path.basename
178
+
179
+ FileUtils.cp_r(assets_path, target_path, :remove_destination => true)
180
+ Pod::UI.puts " 📱 Copied Assets.xcassets: #{relative_path.basename}"
181
+ end
182
+ end
183
+
184
+ # 4. 处理 vendored_frameworks
185
+ unless file_accessor.vendored_frameworks.empty?
186
+ Pod::UI.puts " 🔗 Processing #{file_accessor.vendored_frameworks.count} vendored frameworks"
187
+ file_accessor.vendored_frameworks.each do |vendored_framework|
188
+ if File.exist?(vendored_framework)
189
+ framework_name = vendored_framework.basename
190
+ target_path = Pathname(framework_path).dirname + framework_name
191
+
192
+ FileUtils.cp_r(vendored_framework, target_path, :remove_destination => true)
193
+ Pod::UI.puts " 🔗 Copied vendored framework: #{framework_name}"
194
+ end
195
+ end
196
+ end
197
+
198
+ # 5. 处理 vendored_libraries
199
+ unless file_accessor.vendored_libraries.empty?
200
+ Pod::UI.puts " 📚 Processing #{file_accessor.vendored_libraries.count} vendored libraries"
201
+ file_accessor.vendored_libraries.each do |vendored_library|
202
+ if File.exist?(vendored_library)
203
+ library_name = vendored_library.basename
204
+ target_path = Pathname(framework_path) + library_name
205
+
206
+ FileUtils.cp_r(vendored_library, target_path, :remove_destination => true)
207
+ Pod::UI.puts " 📚 Copied vendored library: #{library_name}"
208
+ end
209
+ end
210
+ end
211
+
212
+ # 6. iOS 14 特别处理:确保资源目录结构正确
213
+ deployment_target = Pod.min_deployment_target
214
+ if deployment_target && Gem::Version.new(deployment_target) < Gem::Version.new("15.0")
215
+ Pod::UI.puts " 🔧 Applying iOS 14 compatibility fixes..."
216
+
217
+ # 确保 framework 内部有正确的目录结构
218
+ framework_resources_path = Pathname(framework_path) + "Resources"
219
+ framework_resources_path.mkpath unless framework_resources_path.exist?
220
+
221
+ Pod::UI.puts " ✅ iOS 14 compatibility applied"
222
+ end
223
+
224
+ Pod::UI.puts "✅ Resource processing completed for #{target.name}"
225
+ end
226
+
130
227
  def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[])
131
228
  args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} )
132
229
  platform = PLATFORMS[sdk]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binary-matchup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - leavez