cocoapods-bb-PodAssistant 0.3.12.5 → 0.3.12.6

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: 2e50e664fa0119dbfae913afa7be868479ff7bbf10b0400cbae0c001e964b383
4
- data.tar.gz: eb86977077f139ac0d9d807cb9576bb3fdc2b121c4eab9568c6af4f53cdf7d19
3
+ metadata.gz: ab54c5c6b56fecf79f80409e4640b1d490fd1a43cbb3cb25c6950d7b0e4ce41b
4
+ data.tar.gz: 3d9919e095514e2186967ede9e18cec1fb89aa6a6295ba687ce8f5c220c0b52c
5
5
  SHA512:
6
- metadata.gz: 83815f36081eddb0f0e48c4cbd839244146ff54708d9876337b67bc31d7ffc84535ba268b1e5a1e246c43e8ad69fd5e0cb80ea176a226ef3db67922aa3e60a5d
7
- data.tar.gz: 24e79b6a25942fb56e92a434bdba323eaf184a8ea13106a0e1c7f5a061942b3389ee2a8e7e97948d213f74bbb261746c0c88ec6c380d21fe1cd9a884bb466d27
6
+ metadata.gz: 43bcced09599301509cf6b5754cffda942fe35098dfab75a675be1bc1b5a1bdbb70d650c12055a2ad3ff668de7a55571db09c13329394f2248a1c322c13cc3fb
7
+ data.tar.gz: 3d1005b0fb44134cff7ffa413e2c7290a42616b89fde98811c91c54dab636cbf39f65ec3982fa1e0c583f937b573b18cf0741ae4131bce5e2947be8aa6433875
@@ -97,10 +97,28 @@ class PodPostInstaller
97
97
  end
98
98
  end
99
99
 
100
+ private def generate_other_ldflags()
101
+ # new_flags = ['$(inherited)', '-ObjC', '-lxml2', '-lz', '-lstdc++', '-weak_framework', 'SwiftUI', '-Wl,-v', '-Wl,-no_deduplicate']
102
+ new_flags = ['$(inherited)', '-ObjC', '-lxml2', '-lz', '-lc++', '-weak_framework', 'SwiftUI', '-Wl,-v', '-Wl,-no_deduplicate']
103
+ is_above_xcode26 = BB::PodUtils.above_xcode_26_version # 高于26
104
+ is_above_xcode15 = BB::PodUtils.compare_xcode_15_version # 高于15
105
+ if (is_above_xcode26 == true) then
106
+ # 从 Xcode 15.3 起,Apple 已正式废弃 ld-classic,而 Xcode 26 beta 默认强制使用新版链接器(ld64 764.0+)。
107
+ new_flags << '-Wl,-no_application_extension'
108
+ new_flags << '-Wl,-ld_classic'
109
+ elsif (is_above_xcode15 == true) then # iOS17适配添加ld64 https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes
110
+ # c++ weak 标识 xcode15 -ld64 is deprecated, use -ld_classic instead
111
+ new_flags << '-Wl,-ld_classic'
112
+ end
113
+ # 去重并规范化输出
114
+ new_flags.uniq.join(' ')
115
+ end
116
+
100
117
  def run
101
118
  env = BabybusInstallEnv.new()
102
- is_above_xcode15 = BB::PodUtils.compare_xcode_15_version # 高于15
103
- is_below_xcode15 = BB::PodUtils.below_xcode_15_version # 低于15
119
+ # is_above_xcode26 = BB::PodUtils.above_xcode_26_version # 高于26
120
+ # is_above_xcode15 = BB::PodUtils.compare_xcode_15_version # 高于15
121
+ # is_below_xcode15 = BB::PodUtils.below_xcode_15_version # 低于15
104
122
  # 是否Untify项目
105
123
  isUnityProject = isUnityApp
106
124
  # Untify项目需要移除cocos项目res/src目录
@@ -111,6 +129,8 @@ class PodPostInstaller
111
129
  puts "pod组件配置工程最低支持iOS系统 ===> #{ios_deployment_target.to_s.send(:red)}".green
112
130
  @lib.aggregate_targets.first.user_project.save # 解决Xcode13 pod update操作出现failed to save pods.xcodeproj问题 by hm 21/11/8
113
131
  project = Xcodeproj::Project.open(BB::PodUtils.getXcodeprojPath)
132
+ should_save = false
133
+ new_ldflags = generate_other_ldflags()
114
134
  project.targets.each do |target|
115
135
  target.build_configurations.each do |config|
116
136
  # if !target.name.include? 'test'
@@ -125,19 +145,19 @@ class PodPostInstaller
125
145
  end
126
146
  end
127
147
  # xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f if xcode_version ≥ 15
128
- # iOS17适配添加ld64 https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes
129
- if (is_above_xcode15 == true) then
130
- # c++ weak 标识 xcode15 -ld64 is deprecated, use -ld_classic instead
131
- config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++ -Wl -ld_classic -weak_framework SwiftUI"
148
+ key = 'OTHER_LDFLAGS'
149
+ old_ldflags = Array(config.build_settings[key]).join(' ').strip
150
+ if old_ldflags != new_ldflags
151
+ config.build_settings[key] = new_ldflags
152
+ should_save = true
153
+ puts "[Updated] #{target.name} #{config.name}: OTHER_LDFLAGS changed Value: #{new_ldflags}".green
132
154
  else
133
- config.build_settings['OTHER_LDFLAGS'] = "$(inherited) -lxml2 -lz -ObjC -lstdc++"
155
+ puts "[Skipped] #{target.name} #{config.name}: already up-to-date".yellow
134
156
  end
135
- otherLink_setting_value = config.build_settings['OTHER_LDFLAGS']
136
- puts "#{target.name}-#{config.name} Build Setting 'OTHER_LDFLAGS' Value: #{otherLink_setting_value}"
137
-
138
157
  # 配置工程最低部署
139
158
  origin_value = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
140
159
  if origin_value.to_i != ios_deployment_target.to_i
160
+ should_save = true
141
161
  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ios_deployment_target.to_s
142
162
  new_value = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
143
163
  puts "#{target.name}-#{config.name} Build Setting 'IPHONEOS_DEPLOYMENT_TARGET' deployment target: #{origin_value} => #{new_value}"
@@ -201,10 +221,8 @@ class PodPostInstaller
201
221
  if fix_phases
202
222
  fix_phases.always_out_of_date = "1"
203
223
  end
204
- if (is_below_xcode15 == true) then
205
- project.save
206
- end
207
224
  end
225
+ project.save if should_save
208
226
  # 修正Xcode16不能po问题
209
227
  fix_above_xcode16_no_po()
210
228
  end
@@ -221,7 +221,7 @@ module BB
221
221
  dependenciesdata = common_specs[YAML_CONFIG_DEPENDENCIES_KEY]
222
222
 
223
223
  # puts "local_specs:#{local_specs}".send(:green)
224
- # puts "common_specs:#{common_specs}".send(:green)
224
+ # puts "common_specs:#{common_specs}".send(:red)
225
225
  need_update_pod_lists={}
226
226
  # step.1 匹配组件版本信息
227
227
  listdata.each do |name, version|
@@ -292,12 +292,30 @@ module BB
292
292
  showMergeLog(added_projects, updated_projects, rollbacked_projects, deleted_projects)
293
293
  # step.4 强制更新组件
294
294
  if is_force == true
295
- puts "强制升级组件#{update_pods}".red
295
+ puts "[update]升级组件#{update_pods}".red
296
+ business_listdata = {}
297
+ # 业务线数据
298
+ business_config_file = business_stable_yaml
299
+ if business_config_file
300
+ if File.exist?(business_config_file)
301
+ busimessSpec = BB::StableSpecs.new()
302
+ busimess_data = busimessSpec.readData(business_config_file)
303
+ if busimess_data
304
+ business_listdata = busimess_data[YAML_CONFIG_LIST_KEY]
305
+ end
306
+ end
307
+ end
296
308
  update_pods.each do |pod_name|
297
- pod = new_specs[pod_name]
298
- if (pod.is_a? String) && !pod.include?('>=')
299
- puts "强制升级name:#{pod_name} (>= #{pod})".red
300
- new_specs[pod_name] = ">= #{pod}"
309
+ business_ver = business_listdata[pod_name]
310
+ if business_ver
311
+ puts "[update]业务spec专属组件库升级信息:#{pod_name} (#{business_ver})".yellow
312
+ new_specs[pod_name] = "= #{business_ver}"
313
+ else
314
+ pod = new_specs[pod_name]
315
+ if (pod.is_a? String) && !pod.include?('>=')
316
+ puts "[update]公共组件库升级信息:#{pod_name} (>= #{pod})".yellow
317
+ new_specs[pod_name] = ">= #{pod}"
318
+ end
301
319
  end
302
320
  end
303
321
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBbPodassistant
2
- VERSION = "0.3.12.5"
2
+ VERSION = "0.3.12.6"
3
3
  end
@@ -170,5 +170,21 @@ module BB
170
170
  end
171
171
  return false
172
172
  end
173
+ # xcode26以下
174
+ def self.below_xcode_26_version
175
+ return !above_xcode_26_version
176
+ end
177
+ # xcode26以上
178
+ def self.above_xcode_26_version
179
+ current_version = xcode_version
180
+ if current_version.nil?
181
+ puts "未找到安装的Xcode版本。".red
182
+ else
183
+ puts "当前Xcode版本:#{current_version}"
184
+ num_ver = current_version.to_i
185
+ return num_ver >= 26
186
+ end
187
+ return false
188
+ end
173
189
  end
174
190
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-PodAssistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12.5
4
+ version: 0.3.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin