cocoapods-bb-PodAssistant 0.3.11.1 → 0.3.12.1

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: f24cb36efee097e747c10f4f2d4f7746bc48711818b02c13db8748dde4b3eec6
4
+ data.tar.gz: 7a2c0fbc83879774f5bef6b4b4162ded38076953e378d76394c2f441dbc0a170
5
5
  SHA512:
6
- metadata.gz: 222c1d098ca82d2a80ae4f2131a53a4be7643ae4281375ca4d1255090c2e881371a6a2d60f9a8ff69f58b9c2ff716e12a480d4843bcf5a53a75578c42b345dd2
7
- data.tar.gz: 637405ffdf27673035be531c77715ecdd8e5c3792bb5b4985c360d3af3052679955add2661432df1719406459133aba45fde69ed363ec39471d3ed826b5ccb88
6
+ metadata.gz: 5b72cb59afd1d49622913c3b65040e93f93331f12a1f7c20c9b35cd8a88d182bdaa81c2507d752d8a76bd804c1d20f6bf64094a63b13470e934352d99f337cac
7
+ data.tar.gz: 7151e24ab59a31c0d631937257a9901d9c2a10736b093190eca261bbef24714ff7d23f197270133b0f650b7b292ac8873f608067e3aac6be0572f77ef6ae2a06
@@ -125,17 +125,22 @@ def isCityApp
125
125
  return bundleId === "com.sinyee.babybus.city"
126
126
  end
127
127
 
128
- # 是否创意世界产品
128
+ # 是否创意世界产品(海外)
129
129
  def isGameWorldApp
130
130
  bundleId = getProjectBundleIdentifier()
131
131
  return bundleId === "com.sinyee.babybus.gameworld"
132
132
  end
133
+ # 是否创意世界产品(国内)
134
+ def isBingoworldApp
135
+ bundleId = getProjectBundleIdentifier()
136
+ return bundleId === "com.joltrix.bingoworld"
137
+ end
133
138
 
134
139
  # 是否矩阵产品
135
140
  def isMatrixApp
136
141
  bundleId = getProjectBundleIdentifier()
137
142
  puts "###bundleId:#{bundleId}###".red
138
- if (isHanZiApp || isQMWApp || isPinyinAppp || isCourseApp || isMathApp || isABCApp || isCityApp) then
143
+ if (isHanZiApp || isQMWApp || isPinyinAppp || isCourseApp || isMathApp || isABCApp || isCityApp || isGameWorldApp || isBingoworldApp) then
139
144
  return false
140
145
  end
141
146
  return true
@@ -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.1"
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.1
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-04-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: cocoapods-core
@@ -169,7 +169,6 @@ files:
169
169
  - lib/cocoapods-bb-PodAssistant/command/stable/update.rb
170
170
  - lib/cocoapods-bb-PodAssistant/config/cache_path.rb
171
171
  - lib/cocoapods-bb-PodAssistant/config/data_config.rb
172
- - lib/cocoapods-bb-PodAssistant/config/json_parser.rb
173
172
  - lib/cocoapods-bb-PodAssistant/config/source_manager.rb
174
173
  - lib/cocoapods-bb-PodAssistant/config/stable_source.rb
175
174
  - lib/cocoapods-bb-PodAssistant/config/stable_specs.rb
@@ -218,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
217
  - !ruby/object:Gem::Version
219
218
  version: '0'
220
219
  requirements: []
221
- rubygems_version: 3.6.2
220
+ rubygems_version: 3.6.5
222
221
  specification_version: 4
223
222
  summary: A longer description of cocoapods-bb-PodAssistant.
224
223
  test_files: []
@@ -1,53 +0,0 @@
1
- require 'json'
2
-
3
- module BB
4
- class JsonParser
5
- attr_reader :json_data
6
-
7
- # 初始化,读取并解析 JSON 文件
8
- def initialize(file_path)
9
- @file_path = file_path
10
- @json_data = read_json
11
- end
12
-
13
- # 读取并解析 JSON 文件
14
- def read_json
15
- begin
16
- file_content = File.read(@file_path)
17
- JSON.parse(file_content)
18
- rescue Errno::ENOENT
19
- puts "错误:找不到文件 #{@file_path}"
20
- nil
21
- rescue JSON::ParserError
22
- puts "错误:JSON 解析失败,请检查文件格式"
23
- nil
24
- end
25
- end
26
-
27
- # 遍历 JSON 并返回 key-value 结构
28
- def traverse_json(data = @json_data, prefix = "", result = {})
29
- return result unless data
30
-
31
- case data
32
- when Hash
33
- data.each do |key, value|
34
- traverse_json(value, "#{prefix}#{key}.", result)
35
- end
36
- when Array
37
- data.each_with_index do |value, index|
38
- traverse_json(value, "#{prefix}[#{index}].", result)
39
- end
40
- else
41
- result[prefix.chomp('.')] = data
42
- end
43
-
44
- result
45
- end
46
-
47
- # 提供给业务方的获取 JSON 数据方法
48
- def get_json_data
49
- return {} unless @json_data
50
- traverse_json
51
- end
52
- end
53
- end