cocoapods-bb-PodAssistant 0.3.12.5 → 0.3.13.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 +4 -4
- data/lib/cocoapods-bb-PodAssistant/babybus/installer/post_install_hooks.rb +31 -13
- data/lib/cocoapods-bb-PodAssistant/command/stable/push.rb +86 -47
- data/lib/cocoapods-bb-PodAssistant/config/source_manager.rb +29 -16
- data/lib/cocoapods-bb-PodAssistant/gem_version.rb +1 -1
- data/lib/cocoapods-bb-PodAssistant/helpers/pod_utils.rb +16 -0
- data/lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb +2 -8
- 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: e987c7880cf9a36436c3340d58f869212e12862eb34a7035d65a1240c37fa6e1
|
4
|
+
data.tar.gz: 6d4ecac719da36fcee693b1f14527245bf8a731d3395e784b071af5c0376adc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2654efaca16ff583496a8f218538b65f6e917580599299bbd2f6f476d62ebc680b1f430c0c46efaf5465adfc0dc41b15ff4b92d8d183e50c0641b280fc49b8d6
|
7
|
+
data.tar.gz: c4212306220fb74f197dd8040e623e9aa7980665e0f3ddf3db0a318c81ee1d94bb7b48eba86628683123b660549b5501e75e18f7daa5c619887db3c0bfdb9305
|
@@ -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
|
-
|
103
|
-
|
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
|
-
|
129
|
-
|
130
|
-
|
131
|
-
config.build_settings[
|
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
|
-
|
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
|
@@ -11,11 +11,17 @@ module Pod
|
|
11
11
|
常用命令如下:\n
|
12
12
|
更新所有公共组件: `pod stable push`\n
|
13
13
|
更新指定公共组件: `pod stable push <组件名称>`\n
|
14
|
+
更新指定spec公共组件: `pod stable push <组件名称> --stable-specs-index=spec 索引`\n
|
14
15
|
更新指定公共组件/移除组件: `pod stable push <组件名称> --remove=组件名称` #多个移除名称带`,`\n
|
15
16
|
更新指定公共组件/带依赖关系: `pod stable push <组件名称> --dependencies=组件名称` #多个依赖名称带`,`\n
|
16
17
|
更新指定公共组件/带依赖关系/移除组件: `pod stable push <组件名称> --dependencies=组件名称 --remove=组件名称` #多个依赖名称带`,`\n
|
17
|
-
|
18
|
+
参数说明:\n
|
19
|
+
--dependencies=依赖组件\n
|
20
|
+
--remove=需要移除组件\n
|
21
|
+
--stable-specs-index=指定业务specs索引-0:公共(默认) 1:矩阵全线升级 2:拉布 3:科学 4:思维\n
|
18
22
|
DESC
|
23
|
+
# --update-matrix 更新矩阵产品公共业务线\n
|
24
|
+
# --update-common 更新公共组件\n
|
19
25
|
|
20
26
|
self.arguments = [
|
21
27
|
CLAide::Argument.new('POD_NAMES', false, true),
|
@@ -25,8 +31,7 @@ module Pod
|
|
25
31
|
[
|
26
32
|
['--dependencies', '依赖组件名称,多个使用`,`隔开'],
|
27
33
|
['--remove', '移除公共组件名称,多个使用`,`隔开'],
|
28
|
-
['--
|
29
|
-
['--update-common', '更新公共组件,默认false'],
|
34
|
+
['--stable-specs-index', '指定业务specs索引-0:公共(默认) 1:矩阵全线升级 2:拉布 3:科学 4:思维,参照podfile配置信息'],
|
30
35
|
].concat(super)
|
31
36
|
end
|
32
37
|
|
@@ -34,65 +39,99 @@ module Pod
|
|
34
39
|
@pods = argv.arguments!
|
35
40
|
@dependencies = argv.option('dependencies', nil)&.split(',')
|
36
41
|
@remove = argv.option('remove', nil)&.split(',')
|
37
|
-
@
|
38
|
-
@
|
42
|
+
@version = argv.option('version')
|
43
|
+
@stable_specs_index = argv.option('stable-specs-index', 0).to_i
|
44
|
+
@is_public_data = false
|
39
45
|
super
|
40
46
|
end
|
41
47
|
|
42
48
|
def run
|
43
49
|
puts "[PodAssistant] 开始执行 $ pod stable push".yellow
|
44
|
-
|
50
|
+
puts "stable_specs_project_name:#{get_stable_project_name} stable_specs_name:#{get_stable_spec_name}"
|
51
|
+
|
52
|
+
source_manager = BB::SourceManager.new(false, get_stable_spec_name)
|
45
53
|
cachePath = source_manager.cache_path
|
46
54
|
puts "stable cache git=>#{cachePath}"
|
47
55
|
Dir.chdir(File.join(cachePath)) {
|
48
|
-
|
49
|
-
|
50
|
-
Dir.
|
51
|
-
|
52
|
-
|
53
|
-
if
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
56
|
+
path = get_stable_project_path
|
57
|
+
# puts "path:#{path}".red
|
58
|
+
if Dir.exist?(path)
|
59
|
+
Dir.chdir(File.join(path)) {
|
60
|
+
commit_msg = ""
|
61
|
+
if @pods.any?
|
62
|
+
if (@pods.length > 1) && (@dependencies)
|
63
|
+
puts "❌ 无效指令,不能处理多个组件#{@pods}依赖,更新组件仅支持单组件".red
|
64
|
+
puts "举例:pod stable push <单组件> --dependencies=<多组件>".green
|
65
|
+
puts "详见 pod stable push --help".green
|
66
|
+
system "pod stable push --help"
|
67
|
+
exit
|
68
|
+
elsif (@pods.length == 1) && (@dependencies || @remove)
|
69
|
+
pod_name=@pods.first
|
70
|
+
dependencies_hash = {}
|
71
|
+
if @dependencies
|
72
|
+
dependencies_hash[pod_name] = @dependencies
|
73
|
+
end
|
74
|
+
if @is_public_data
|
75
|
+
source_manager.update_common_dependencies_and_remove_data(dependencies_hash, @remove)
|
76
|
+
else
|
77
|
+
source_manager.update_business_dependencies_and_remove_data(dependencies_hash, @remove)
|
78
|
+
end
|
64
79
|
end
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
80
|
+
pods_str = @pods.join(" ")
|
81
|
+
system "pod stable update #{pods_str}"
|
82
|
+
commit_msg = "update pod #{pods_str}"
|
83
|
+
else
|
84
|
+
if (@dependencies) || (@remove)
|
85
|
+
puts "❌ 无效指令,没有制定组件名称 详见 pod stable push --help".red
|
86
|
+
system "pod stable push --help"
|
87
|
+
exit
|
69
88
|
end
|
89
|
+
system "pod stable update"
|
70
90
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
exit
|
79
|
-
end
|
80
|
-
system "pod stable update"
|
81
|
-
end
|
82
|
-
# 提交spec本地lock依赖,避免pod stable push <组件>出现组件版本回退问题
|
83
|
-
source_manager.commit_localspec_data(@is_matrix, commit_msg)
|
84
|
-
}
|
91
|
+
# 提交spec本地lock依赖,避免pod stable push <组件>出现组件版本回退问题
|
92
|
+
source_manager.commit_localspec_data(commit_msg)
|
93
|
+
}
|
94
|
+
else
|
95
|
+
puts "❌ 无效stable工程,请确认:#{get_stable_project_name}是否创建,at@hm".red
|
96
|
+
exit
|
97
|
+
end
|
85
98
|
}
|
86
99
|
end
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
100
|
+
# 0:公共(默认) 1:矩阵全线升级 2:拉布 3:科学 4:思维
|
101
|
+
private def get_stable_spec_name
|
102
|
+
case @stable_specs_index
|
103
|
+
when 1 # 全线矩阵产品公共stable目录
|
104
|
+
return 'global_stable_specs'
|
105
|
+
when 2 # labu产品公共stable目录
|
106
|
+
return 'labu_stable_specs'
|
107
|
+
when 3 # science产品公共stable目录
|
108
|
+
return 'science_stable_specs'
|
109
|
+
when 4 # math产品公共stable目录
|
110
|
+
return 'math_stable_specs'
|
111
|
+
else # 公共stable目录
|
112
|
+
return 'stable_specs'
|
113
|
+
end
|
91
114
|
end
|
92
|
-
#
|
93
|
-
private def
|
94
|
-
|
115
|
+
# 0:公共(默认) 1:矩阵全线升级 2:拉布 3:科学 4:思维
|
116
|
+
private def get_stable_project_name
|
117
|
+
case @stable_specs_index
|
118
|
+
when 1 # 全线矩阵产品公共stable目录
|
119
|
+
return 'Matrix_Common_Stable'
|
120
|
+
when 2 # labu产品公共stable目录
|
121
|
+
return 'labu_Common_Stable'
|
122
|
+
when 3 # science产品公共stable目录
|
123
|
+
return 'science_Common_Stable'
|
124
|
+
when 4 # math产品公共stable目录
|
125
|
+
return 'math_Common_Stable'
|
126
|
+
else # 公共stable目录
|
127
|
+
@is_public_data = true
|
128
|
+
return 'Common_Stable'
|
129
|
+
end
|
95
130
|
end
|
131
|
+
private def get_stable_project_path
|
132
|
+
return File.join(Dir.pwd, get_stable_project_name)
|
133
|
+
end
|
134
|
+
|
96
135
|
end
|
97
136
|
end
|
98
137
|
end
|
@@ -8,9 +8,9 @@ require 'cocoapods-bb-PodAssistant/config/data_config'
|
|
8
8
|
# 数据源管理
|
9
9
|
module BB
|
10
10
|
class SourceManager
|
11
|
-
def initialize(verify_stable_env=true,
|
12
|
-
@env = BB::StableEnv.new(verify_stable_env,
|
13
|
-
@businessSpecName =
|
11
|
+
def initialize(verify_stable_env=true, businessSpec=nil)
|
12
|
+
@env = BB::StableEnv.new(verify_stable_env, businessSpec)
|
13
|
+
@businessSpecName = businessSpec
|
14
14
|
@stableMgr = BB::StableManager.new(@env, verify_stable_env)
|
15
15
|
end
|
16
16
|
|
@@ -197,13 +197,8 @@ module BB
|
|
197
197
|
def update_business_dependencies_and_remove_data(dependencies_pods, remove_pods)
|
198
198
|
update_dependencies_and_remove_data(business_stable_yaml, business_stable_datas, dependencies_pods, remove_pods)
|
199
199
|
end
|
200
|
-
def commit_localspec_data(
|
201
|
-
|
202
|
-
stable_yaml = business_stable_yaml
|
203
|
-
else
|
204
|
-
stable_yaml = public_stable_yaml
|
205
|
-
end
|
206
|
-
commit_git_data(stable_yaml, commit_msg)
|
200
|
+
def commit_localspec_data(commit_msg)
|
201
|
+
commit_git_data(business_stable_yaml, commit_msg)
|
207
202
|
end
|
208
203
|
def commit_git_data(stable_yaml, commit_msg)
|
209
204
|
@stableMgr.commit_data(stable_yaml, commit_msg)
|
@@ -221,7 +216,7 @@ module BB
|
|
221
216
|
dependenciesdata = common_specs[YAML_CONFIG_DEPENDENCIES_KEY]
|
222
217
|
|
223
218
|
# puts "local_specs:#{local_specs}".send(:green)
|
224
|
-
# puts "common_specs:#{common_specs}".send(:
|
219
|
+
# puts "common_specs:#{common_specs}".send(:red)
|
225
220
|
need_update_pod_lists={}
|
226
221
|
# step.1 匹配组件版本信息
|
227
222
|
listdata.each do |name, version|
|
@@ -292,12 +287,30 @@ module BB
|
|
292
287
|
showMergeLog(added_projects, updated_projects, rollbacked_projects, deleted_projects)
|
293
288
|
# step.4 强制更新组件
|
294
289
|
if is_force == true
|
295
|
-
puts "
|
290
|
+
puts "[update]升级组件#{update_pods}".red
|
291
|
+
business_listdata = {}
|
292
|
+
# 业务线数据
|
293
|
+
business_config_file = business_stable_yaml
|
294
|
+
if business_config_file
|
295
|
+
if File.exist?(business_config_file)
|
296
|
+
busimessSpec = BB::StableSpecs.new()
|
297
|
+
busimess_data = busimessSpec.readData(business_config_file)
|
298
|
+
if busimess_data
|
299
|
+
business_listdata = busimess_data[YAML_CONFIG_LIST_KEY]
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
296
303
|
update_pods.each do |pod_name|
|
297
|
-
|
298
|
-
if
|
299
|
-
puts "
|
300
|
-
new_specs[pod_name] = "
|
304
|
+
business_ver = business_listdata[pod_name]
|
305
|
+
if business_ver
|
306
|
+
puts "[update]业务spec专属组件库升级信息:#{pod_name} (#{business_ver})".yellow
|
307
|
+
new_specs[pod_name] = "= #{business_ver}"
|
308
|
+
else
|
309
|
+
pod = new_specs[pod_name]
|
310
|
+
if (pod.is_a? String) && !pod.include?('>=')
|
311
|
+
puts "[update]公共组件库升级信息:#{pod_name} (>= #{pod})".yellow
|
312
|
+
new_specs[pod_name] = ">= #{pod}"
|
313
|
+
end
|
301
314
|
end
|
302
315
|
end
|
303
316
|
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
|
@@ -2,9 +2,9 @@ require 'cocoapods-bb-PodAssistant/config/stable_source'
|
|
2
2
|
|
3
3
|
module BB
|
4
4
|
class StableEnv
|
5
|
-
def initialize(verify_stable_env=true,
|
5
|
+
def initialize(verify_stable_env=true, businessSpec=nil)
|
6
6
|
@cache = BB::Cache.new(nil, verify_stable_env)
|
7
|
-
@
|
7
|
+
@businessSpec = businessSpec
|
8
8
|
configGitPath(@cache.cachePath)
|
9
9
|
if verify_stable_env
|
10
10
|
# 自动加载stable环境
|
@@ -102,14 +102,8 @@ module BB
|
|
102
102
|
return @stable_tag
|
103
103
|
end
|
104
104
|
def business_stable
|
105
|
-
if @businessSpec.nil? && @isMatrix
|
106
|
-
return default_matrix_business_stable
|
107
|
-
end
|
108
105
|
return @businessSpec
|
109
106
|
end
|
110
|
-
def default_matrix_business_stable
|
111
|
-
return "global_stable_specs"
|
112
|
-
end
|
113
107
|
# 验证stable环境是否存在
|
114
108
|
def verify_stable_env_exists
|
115
109
|
return @stable_source.empty? ? false : true
|