cocoapods-bb-PodAssistant 0.3.16.6 → 0.3.16.8
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 +4 -4
- data/lib/cocoapods-bb-PodAssistant/babybus/installer/post_install_hooks.rb +47 -25
- data/lib/cocoapods-bb-PodAssistant/babybus/installer/post_integrate_hooks.rb +9 -0
- data/lib/cocoapods-bb-PodAssistant/gem_version.rb +1 -1
- data/lib/cocoapods-bb-PodAssistant/helpers/pod_module_helper.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4088855ba536056a694f3df4343768b8b6613a1000014e5b1e86d11188e3200
|
|
4
|
+
data.tar.gz: df9e641a54b8eeb4181df5fec530c24e164245e053f96f4ca9cb6e02f937811b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81e30f10794cb18fa92eeaf043dae86247e6d1421d600467aa249347869699af7603fdf6f6ff0f305c04f85b89e5b5c66eb0b9dc716456d8396b76acc82e1232
|
|
7
|
+
data.tar.gz: 8b095a352774edd065cfc2e6d40d17f004188a600da6ac97bb8991c075a6dc07c50dd6c9c489e61592502da3f729715ba0c515291265a62d2832a032c1cf0140
|
|
@@ -37,6 +37,13 @@ class PodPostInstaller
|
|
|
37
37
|
end
|
|
38
38
|
@is_matrix = is_matrix
|
|
39
39
|
@is_replaceMinVersionForMultiTarget = is_replaceMinVersionForMultiTarget
|
|
40
|
+
# Unity是否支持Simulator,由业务方设置为1开启,默认关闭
|
|
41
|
+
@unity_simulator_supported = ENV['UNITY_SIMULATOR_SUPPORTED'] == '1'
|
|
42
|
+
if @unity_simulator_supported
|
|
43
|
+
puts "当前Unity SDK 支持 Simulator"
|
|
44
|
+
else
|
|
45
|
+
puts "当前Unity SDK 不支持 Simulator".yellow
|
|
46
|
+
end
|
|
40
47
|
end
|
|
41
48
|
private def filterTargetName(target_name)
|
|
42
49
|
for name in @filter_targets
|
|
@@ -175,6 +182,25 @@ install_framework()
|
|
|
175
182
|
# new_flags.uniq.join(' ') #xcode26就是有多个Xlinker,故不能去重
|
|
176
183
|
end
|
|
177
184
|
|
|
185
|
+
private def fix_above_xcode27_excluded_archs(config)
|
|
186
|
+
key = 'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
|
|
187
|
+
excluded_archs = config.build_settings[key]
|
|
188
|
+
return if excluded_archs.nil?
|
|
189
|
+
archs = excluded_archs.to_s.split.reject { |arch| arch == 'arm64' }
|
|
190
|
+
if archs.empty?
|
|
191
|
+
config.build_settings.delete(key)
|
|
192
|
+
else
|
|
193
|
+
config.build_settings[key] = archs.join(' ')
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
private def config_unity_simulator_supported(config)
|
|
198
|
+
definitions = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] || ['$(inherited)']
|
|
199
|
+
definitions = [definitions] unless definitions.is_a?(Array)
|
|
200
|
+
definitions << 'BB_UNITY_SIMULATOR_SUPPORTED=1' unless definitions.include?('BB_UNITY_SIMULATOR_SUPPORTED=1')
|
|
201
|
+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = definitions
|
|
202
|
+
end
|
|
203
|
+
|
|
178
204
|
def run
|
|
179
205
|
env = BabybusInstallEnv.new()
|
|
180
206
|
is_above_xcode27 = BB::PodUtils.above_xcode_27_version # 高于27
|
|
@@ -195,6 +221,7 @@ install_framework()
|
|
|
195
221
|
project = Xcodeproj::Project.open(BB::PodUtils.getXcodeprojPath)
|
|
196
222
|
should_save = false
|
|
197
223
|
base_ldflags = generate_other_ldflags()
|
|
224
|
+
# 工程配置
|
|
198
225
|
project.targets.each do |target|
|
|
199
226
|
target.build_configurations.each do |config|
|
|
200
227
|
# if !target.name.include? 'test'
|
|
@@ -215,11 +242,13 @@ install_framework()
|
|
|
215
242
|
# 确保 inherited 在
|
|
216
243
|
origin_flags.unshift('$(inherited)') unless origin_flags.include?('$(inherited)')
|
|
217
244
|
linkmap_flag = '-Wl,-map,$(CONFIGURATION_BUILD_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt'
|
|
218
|
-
if config.name.include?('Debug')
|
|
219
|
-
|
|
220
|
-
else
|
|
221
|
-
|
|
222
|
-
end
|
|
245
|
+
# if config.name.include?('Debug')
|
|
246
|
+
# new_ldflags << linkmap_flag unless new_ldflags.include?(linkmap_flag)
|
|
247
|
+
# else
|
|
248
|
+
# new_ldflags.delete(linkmap_flag)
|
|
249
|
+
# end
|
|
250
|
+
new_ldflags.delete(linkmap_flag) # 提升效率
|
|
251
|
+
|
|
223
252
|
# puts "====#{target.name}-#{config.name} beigin====="
|
|
224
253
|
# puts "origin_flags:#{origin_flags}"
|
|
225
254
|
# puts "new_ldflags:#{new_ldflags}"
|
|
@@ -231,6 +260,7 @@ install_framework()
|
|
|
231
260
|
else
|
|
232
261
|
puts "[Skipped] #{target.name} #{config.name}: already up-to-date"
|
|
233
262
|
end
|
|
263
|
+
|
|
234
264
|
# 配置工程最低部署:
|
|
235
265
|
# 1. 多 Target 产品显式开启替换时继续保持原有行为;
|
|
236
266
|
# 2. Xcode 27+ 强制将工程最低支持版本统一为 ios_deployment_target。
|
|
@@ -243,17 +273,10 @@ install_framework()
|
|
|
243
273
|
puts "#{target.name}-#{config.name} Build Setting 'IPHONEOS_DEPLOYMENT_TARGET' deployment target: #{origin_value} => #{new_value}"
|
|
244
274
|
end
|
|
245
275
|
end
|
|
276
|
+
|
|
246
277
|
# Xcode27去除EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
|
|
247
278
|
if (is_above_xcode27 == true) then
|
|
248
|
-
|
|
249
|
-
excluded_archs = config.build_settings[key]
|
|
250
|
-
next if excluded_archs.nil?
|
|
251
|
-
archs = excluded_archs.to_s.split.reject { |arch| arch == 'arm64' }
|
|
252
|
-
if archs.empty?
|
|
253
|
-
config.build_settings.delete(key)
|
|
254
|
-
else
|
|
255
|
-
config.build_settings[key] = archs.join(' ')
|
|
256
|
-
end
|
|
279
|
+
fix_above_xcode27_excluded_archs(config)
|
|
257
280
|
end
|
|
258
281
|
end
|
|
259
282
|
end
|
|
@@ -265,7 +288,7 @@ install_framework()
|
|
|
265
288
|
config.build_settings['ARCHS'] = "$(ARCHS_STANDARD)"
|
|
266
289
|
end
|
|
267
290
|
end
|
|
268
|
-
#
|
|
291
|
+
# 组件配置
|
|
269
292
|
@lib.pod_target_subprojects.flat_map { |p| p.targets }.each do |target|
|
|
270
293
|
target.build_configurations.each do |config|
|
|
271
294
|
# pod 1.13.0兼容故去除,避免
|
|
@@ -316,18 +339,17 @@ install_framework()
|
|
|
316
339
|
else
|
|
317
340
|
config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = "$(inherited)"
|
|
318
341
|
end
|
|
342
|
+
|
|
343
|
+
# Unity 支持模拟器时,为 BBGameModule 注入编译宏,供 Objective-C/C/C++ 代码判断
|
|
344
|
+
if (target.name == 'BBGameModule') && (@unity_simulator_supported) then
|
|
345
|
+
config_unity_simulator_supported(config)
|
|
346
|
+
end
|
|
347
|
+
|
|
319
348
|
# Xcode27去除EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
|
|
320
349
|
if (is_above_xcode27 == true) then
|
|
321
|
-
|
|
322
|
-
excluded_archs = config.build_settings[key]
|
|
323
|
-
next if excluded_archs.nil?
|
|
324
|
-
archs = excluded_archs.to_s.split.reject { |arch| arch == 'arm64' }
|
|
325
|
-
if archs.empty?
|
|
326
|
-
config.build_settings.delete(key)
|
|
327
|
-
else
|
|
328
|
-
config.build_settings[key] = archs.join(' ')
|
|
329
|
-
end
|
|
350
|
+
fix_above_xcode27_excluded_archs(config)
|
|
330
351
|
end
|
|
352
|
+
|
|
331
353
|
end
|
|
332
354
|
# 修复警告 Run script build phase '[CP] Copy Pods Resources' will be run during every build because it does not specify any outputs
|
|
333
355
|
fix_phases = target.shell_script_build_phases.find { |x| x.name == '[CP] Copy XCFrameworks' || 'Create Symlinks to Header Folders' }
|
|
@@ -337,6 +359,6 @@ install_framework()
|
|
|
337
359
|
end
|
|
338
360
|
project.save if should_save
|
|
339
361
|
# 修正Xcode16不能po问题
|
|
340
|
-
fix_above_xcode16_no_po()
|
|
362
|
+
# fix_above_xcode16_no_po() # xcode27不需要
|
|
341
363
|
end
|
|
342
364
|
end
|
|
@@ -43,6 +43,15 @@ class PodPostIntegrate
|
|
|
43
43
|
[]
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
unity_simulator_supported = ENV['UNITY_SIMULATOR_SUPPORTED'] == '1'
|
|
47
|
+
# 业务方传入列表中:
|
|
48
|
+
# 1. cocos2dx.framework 始终排除,避免被当成 Simulator 不支持库处理
|
|
49
|
+
# 2. Unity 支持 Simulator 时,UnityFramework.framework 也排除
|
|
50
|
+
binaries = binaries.reject do |binary|
|
|
51
|
+
binary_name = File.basename(binary.to_s.strip)
|
|
52
|
+
binary_name == 'cocos2dx.framework' ||
|
|
53
|
+
(unity_simulator_supported && binary_name == 'UnityFramework.framework')
|
|
54
|
+
end
|
|
46
55
|
# 默认不支持 Simulator 的二进制 + 外部传入的不支持二进制,过滤空值后统一去重。
|
|
47
56
|
@simulator_unsupported_binaries = (
|
|
48
57
|
DEFAULT_SIMULATOR_UNSUPPORTED_BINARIES + binaries
|
|
@@ -231,7 +231,7 @@ module BB
|
|
|
231
231
|
end
|
|
232
232
|
if (branch && !branch.empty?) || (git && !git.empty?)
|
|
233
233
|
# 项目配置指向分支数据,以本项目为主
|
|
234
|
-
puts "[PodAssistant] #{podName} 指向分支数据 => #{podfile_pod}"
|
|
234
|
+
# puts "[PodAssistant] #{podName} 指向分支数据 => #{podfile_pod}"
|
|
235
235
|
stable_hash[podCoreName] = podfile_pod
|
|
236
236
|
if podName != podCoreName
|
|
237
237
|
need_update_pod_data[podName] = podfile_pod
|