cocoapods-bb-PodAssistant 0.3.11.1 → 0.3.12.0

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: 971e70a6988e79249d00c1ceaab66100569a9813a5d55ccf3ffdb1d8f8fe2183
4
- data.tar.gz: 40e38c5cf1f4118a5773530715163ffb8201d3868ba39a0cc6e58b9c28d16096
3
+ metadata.gz: c66397bead67a3cc7a1742c88936b9d0c68bc6f2691b5cae89114e5d73a2f0de
4
+ data.tar.gz: e5ed5ae160c03ab68f15baf4e78204fccd5e942901c6ee7d05a64c31c84f6a77
5
5
  SHA512:
6
- metadata.gz: 222c1d098ca82d2a80ae4f2131a53a4be7643ae4281375ca4d1255090c2e881371a6a2d60f9a8ff69f58b9c2ff716e12a480d4843bcf5a53a75578c42b345dd2
7
- data.tar.gz: 637405ffdf27673035be531c77715ecdd8e5c3792bb5b4985c360d3af3052679955add2661432df1719406459133aba45fde69ed363ec39471d3ed826b5ccb88
6
+ metadata.gz: 7328f0a1f7598b7f590132714baaca654a9aa65baeec718c0e89dc0f4442fdbc70b4f30761ce40eef2f69b7ee44227c1e9248603b928e7443b4bb2d32f24865b
7
+ data.tar.gz: cdeaaecfdadb30b3f1e6245ed196e07f091210ce35d900e8af90e20241b69d3a4bb6c99bbc1ef8199b1c6be7f1cda5a1cbe538e8bfe6ea9fdd9b06e60e23bec4
@@ -5,6 +5,7 @@ require 'xcodeproj'
5
5
  require 'cocoapods-bb-PodAssistant/babybus/helpers/babybus_info_plist_helper'
6
6
  require 'cocoapods-bb-PodAssistant/babybus/business/babybus_install_environment'
7
7
  require 'cocoapods-bb-PodAssistant/helpers/pod_utils'
8
+ require 'fileutils'
8
9
 
9
10
  class PodPostInstaller
10
11
  def initialize(lib, deployment_target=nil, filter_targets=["test"], is_matrix=true)
@@ -35,6 +36,67 @@ class PodPostInstaller
35
36
  return false
36
37
  end
37
38
 
39
+ # 修正Xcode16静态库不能po问题(打印swift参数、全局变量)
40
+ def fix_above_xcode16_no_po()
41
+ is_above_xcode16 = BB::PodUtils.above_xcode_16_version # 高于16
42
+ if (is_above_xcode16 == true) then
43
+ puts "� CocoaPods: Modifying OTHER_LDFLAGS for Xcode16+ LLDB debugging..."
44
+ @lib.aggregate_targets.each do |target|
45
+ xcconfig_path = File.join(@lib.sandbox.target_support_files_root.to_s, target.name, "#{target.name}.debug.xcconfig")
46
+
47
+ # 确保 xcconfig 文件存在
48
+ next unless File.exist?(xcconfig_path)
49
+
50
+ # 读取 xcconfig 内容
51
+ xcconfig_content = File.read(xcconfig_path)
52
+
53
+ # 查找 EXISTING `OTHER_LDFLAGS`
54
+ match = xcconfig_content.match(/OTHER_LDFLAGS = ([^\n]+)\n/)
55
+ next unless match # 避免 nil 错误
56
+
57
+ xcconfig_new_ld_flags = match[1] # 提取原来的 OTHER_LDFLAGS
58
+
59
+ # 遍历所有 Pod 组件
60
+ target.pod_targets.each do |pod_target|
61
+ if pod_target.build_as_static?
62
+ pod_target_name = pod_target.name
63
+ swiftmodule_path = "$(TARGET_BUILD_DIR)/#{pod_target_name}/#{pod_target_name}.framework/Modules/#{pod_target_name}.swiftmodule/$(NATIVE_ARCH_ACTUAL)-apple-$(SHALLOW_BUNDLE_TRIPLE).swiftmodule"
64
+
65
+ # 避免重复添加相同路径
66
+ unless xcconfig_new_ld_flags.include?(swiftmodule_path)
67
+ xcconfig_new_ld_flags += " -Wl,-add_ast_path,#{swiftmodule_path}"
68
+ end
69
+ end
70
+ end
71
+
72
+ # 替换原有 OTHER_LDFLAGS
73
+ xcconfig_content.gsub!(/OTHER_LDFLAGS = ([^\n]+)\n/, "OTHER_LDFLAGS = #{xcconfig_new_ld_flags}\n")
74
+
75
+ # 写回文件(确保不破坏原有格式)
76
+ FileUtils.cp(xcconfig_path, "#{xcconfig_path}.backup") # 备份原文件
77
+ File.write(xcconfig_path, xcconfig_content)
78
+
79
+ puts "✅ 已添加 SwiftModule 路径到 xcconfig_path: #{xcconfig_path}"
80
+ end
81
+ # @lib.aggregate_targets.each do |target|
82
+ # xcconfig_path = @lib.sandbox.target_support_files_root.to_s + "/#{target.name}/#{target.name}.debug.xcconfig"
83
+ # xcconfig_content = File.read xcconfig_path
84
+ # xcconfig_new_ld_flags = xcconfig_content.match(/OTHER_LDFLAGS = ([^\n]+)\n/)[1]
85
+ # target.pod_targets.each do |pod_target|
86
+ # if pod_target.build_as_static?
87
+ # pod_targetName = pod_target.name
88
+ # xcconfig_new_ld_flags += " -Wl,-add_ast_path,$(TARGET_BUILD_DIR)/#{pod_targetName}/#{pod_targetName}.framework/Modules/#{pod_targetName}.swiftmodule/$(NATIVE_ARCH_ACTUAL)-apple-$(SHALLOW_BUNDLE_TRIPLE).swiftmodule"
89
+ # end
90
+ # end
91
+ # xcconfig_content.gsub! /OTHER_LDFLAGS = ([^\n]+)\n/, "OTHER_LDFLAGS =#{xcconfig_new_ld_flags}\n"
92
+ # File.open(xcconfig_path, 'w') do |f|
93
+ # f.puts xcconfig_content
94
+ # end
95
+ # puts "✅ 已添加 SwiftModule 路径到 xcconfig_path: #{xcconfig_path}"
96
+ # end
97
+ end
98
+ end
99
+
38
100
  def run
39
101
  env = BabybusInstallEnv.new()
40
102
  is_above_xcode15 = BB::PodUtils.compare_xcode_15_version # 高于15
@@ -151,5 +213,7 @@ class PodPostInstaller
151
213
  project.save
152
214
  end
153
215
  end
216
+ # 修正Xcode16不能po问题
217
+ fix_above_xcode16_no_po()
154
218
  end
155
219
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBbPodassistant
2
- VERSION = "0.3.11.1"
2
+ VERSION = "0.3.12.0"
3
3
  end
@@ -78,9 +78,9 @@ module BB
78
78
  # File.rename "#{Dir.home}/.AllPodsTimeAndSize.csv", "#{installer.sandbox_root}/AllPodsTimeAndSize.csv"
79
79
  # puts "具体的统计数据请在#{installer.sandbox_root}/AllPodsTimeAndSize.csv中查看"
80
80
  # end
81
- # 获取时间差
82
- time = $podEndTime - $podStartTime
83
- puts "[PodAssistant] pod操作总耗时【#{time.to_s.send(:red)}秒】start:#{$podStartTime} end:#{$podEndTime}".green
81
+ # 获取时间差
82
+ time = $podEndTime - $podStartTime
83
+ puts "[PodAssistant] pod操作总耗时【#{time.to_s.send(:red)}秒】start:#{$podStartTime} end:#{$podEndTime}".green
84
84
  rescue => exception
85
85
  # 如果没有下载则#{Dir.home}/.AllPodsTimeAndSize.csv文件不会生成,产生异常
86
86
  puts "[PodAssistant] post_install error(已捕获): #{exception}".red
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-PodAssistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11.1
4
+ version: 0.3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-19 00:00:00.000000000 Z
10
+ date: 2025-03-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: cocoapods-core
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.6.2
221
+ rubygems_version: 3.6.5
222
222
  specification_version: 4
223
223
  summary: A longer description of cocoapods-bb-PodAssistant.
224
224
  test_files: []