cocoapods-bb-PodAssistant 0.3.6.1 → 0.3.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f2d52face2f3ba304d2b966d140c60c4d78615b4fd58957cfe92031b232e91e
4
- data.tar.gz: 49ddb7ef3bccd266c636cc0ca6455816f3e6b5937289a081771d5a02ba20ed0d
3
+ metadata.gz: a8516c7300704a3a2ba1e9ee67133ef82364f6187be79ea886565055e9791748
4
+ data.tar.gz: 22475a3cbb929a84f32528dca10c1acdccaed5cc6417e98a406d23c1a54a152e
5
5
  SHA512:
6
- metadata.gz: a9f9becb8300d55c029dc7f7f12555a8dc4186bb6d8b2032c8a7018b38c983f1b28eca3da230e249b92d1f23bdc01f0effdf70fe198718e8d50bdd3049b22ef9
7
- data.tar.gz: 48a1887b14defa100f3ead511e969aa8ebf66158cfdb3c0c919b41ae77a4a4c16e551a01e1e4138d055c3e7409211d0ed0f3faad0b7ab028863f9493bc532dbf
6
+ metadata.gz: 88f91d179f3303d77930e8d6b9f5fa33845676b59c54672190cc151cb324644615b116e331fbf95293f542157f6065138d02f6ef8303d6b5051e7aa5ce5101ce
7
+ data.tar.gz: f0bb1a78c6f5bee58db590fa6634fecc534ed110fdb44ecd18f259a81a1581d8b2abcdb36c63047243233d9f497e034a63683ddcd9ef3d37a08267295d47b356
@@ -0,0 +1,19 @@
1
+ module BB
2
+ class DataConfig
3
+ def self.config
4
+ @config ||= DataConfig.new
5
+ end
6
+
7
+ # 需要过滤忽略组件
8
+ def ignore_dependencies_pod_names
9
+ puts "<===获取业务方配置过滤组件数据:#{@ignore_pods_list}".yellow
10
+ return @ignore_pods_list
11
+ end
12
+
13
+ # 配置过滤忽略组件
14
+ def set_ignore_dependencies_pod_names(pods=[])
15
+ puts "==>业务方配置需要过滤组件数据:#{pods} cls:#{pods.class}".yellow
16
+ @ignore_pods_list=pods
17
+ end
18
+ end
19
+ end
@@ -3,6 +3,7 @@ require 'cocoapods-bb-PodAssistant/config/stable_specs'
3
3
  require 'cocoapods-bb-PodAssistant/helpers/stable_manager_helper'
4
4
  require 'cocoapods-core'
5
5
  require 'cocoapods-bb-PodAssistant/helpers/stable_env_helper'
6
+ require 'cocoapods-bb-PodAssistant/config/data_config'
6
7
 
7
8
  # 数据源管理
8
9
  module BB
@@ -392,7 +393,9 @@ module BB
392
393
  end
393
394
  # 矩阵产品需要过滤组件
394
395
  def matrix_filter_pod_names(pods, ignore_dependencies_pod_names=[])
395
- ignore_dependencies_pod_names=['BBSAdvert'] unless ignore_dependencies_pod_names.nil? # 如果业务方配置,以业务方为主,默认处理广告业务
396
+ if ignore_dependencies_pod_names.nil? || ignore_dependencies_pod_names.length == 0
397
+ ignore_dependencies_pod_names=['BBSAdvert','BBSAdvertCompany'] # 如果业务方配置,以业务方为主,默认处理广告业务
398
+ end
396
399
  find_ok_dependencies_pod_names=[]
397
400
  filter_pod_names=[]
398
401
  whitelist_pods={}
@@ -401,8 +404,14 @@ module BB
401
404
  if ignore_dependencies_pod_names.length > 0
402
405
  puts "业务方配置需要过滤数据:#{ignore_dependencies_pod_names} cls:#{ignore_dependencies_pod_names.class}".yellow
403
406
  pods.each do |pod|
404
- if pod.is_a?(Hash) # 存在依赖关系
407
+ if pod.is_a?(Hash) # 存在字典依赖关系
405
408
  pod_name = pod.keys.first
409
+ elsif pod.is_a?(String) # 存在字符串依赖关系
410
+ pod_name = pod
411
+ else
412
+ pod_name = nil
413
+ end
414
+ if !pod_name.empty?
406
415
  name, version = name_and_version_from_string(pod_name)
407
416
  podCoreName = subspec_podname(name)
408
417
  if ignore_dependencies_pod_names.include?(podCoreName) || find_ok_dependencies_pod_names.include?(name)
@@ -411,23 +420,30 @@ module BB
411
420
  end
412
421
  sub_pods=[]
413
422
  data = pod[pod_name]
414
- data.each do | pod |
415
- dependencies_pod_name = name_from_string(pod)
416
- if dependencies_pod_name.include?(name) #subspecs
417
- if !find_ok_dependencies_pod_names.include?(dependencies_pod_name)
418
- find_ok_dependencies_pod_names.push(dependencies_pod_name)
423
+ # puts "podCoreName:#{podCoreName} type:#{data.class} data:#{data}"
424
+ if data.is_a?(Array) # 存在数组依赖关系
425
+ data.each do | pod |
426
+ dependencies_pod_name = name_from_string(pod)
427
+ if dependencies_pod_name.include?(name) #subspecs
428
+ if !find_ok_dependencies_pod_names.include?(dependencies_pod_name)
429
+ find_ok_dependencies_pod_names.push(dependencies_pod_name)
430
+ end
419
431
  end
420
- end
421
- if !sub_pods.include?(dependencies_pod_name)
422
- sub_pods.push(dependencies_pod_name)
423
- end
424
- tmp_whitelist_pod_names = whitelist_pods[podCoreName]
425
- if (podCoreName != name) && !tmp_whitelist_pod_names.include?(dependencies_pod_name)
426
- dependencies_core_pod_name = subspec_podname(dependencies_pod_name)
427
- if (podCoreName != dependencies_core_pod_name) && !whitelist.include?(dependencies_core_pod_name) && !filter_pod_names.include?(dependencies_core_pod_name)
428
- filter_pod_names.push(dependencies_core_pod_name)
432
+ if !sub_pods.include?(dependencies_pod_name)
433
+ sub_pods.push(dependencies_pod_name)
434
+ end
435
+ tmp_whitelist_pod_names = whitelist_pods[podCoreName]
436
+ if (podCoreName != name) && !tmp_whitelist_pod_names.include?(dependencies_pod_name)
437
+ dependencies_core_pod_name = subspec_podname(dependencies_pod_name)
438
+ if (podCoreName != dependencies_core_pod_name) && !whitelist.include?(dependencies_core_pod_name) && !filter_pod_names.include?(dependencies_core_pod_name)
439
+ filter_pod_names.push(dependencies_core_pod_name)
440
+ end
429
441
  end
430
442
  end
443
+ elsif data.is_a?(String) # 存在字符串依赖关系
444
+ if !whitelist.include?(podCoreName) && !filter_pod_names.include?(podCoreName)
445
+ filter_pod_names.push(podCoreName)
446
+ end
431
447
  end
432
448
  if podCoreName == name
433
449
  whitelist_pods[podCoreName]=sub_pods
@@ -459,7 +475,8 @@ module BB
459
475
  end
460
476
  # 生成项目stable配置文件
461
477
  # 策略:根据podfile.lock dependencies依赖记录pod core标签/分支数据,不存储subspec数据
462
- def generate_localStable(ignore_dependencies_pod_names=[])
478
+ def generate_localStable()
479
+ ignore_dependencies_pod_names = BB::DataConfig.config.ignore_dependencies_pod_names
463
480
  lockfile = podfile_lock
464
481
  local_specs = {}
465
482
  internal_data = lockfile.internal_data
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBbPodassistant
2
- VERSION = "0.3.6.1"
2
+ VERSION = "0.3.7.0"
3
3
  end
@@ -21,17 +21,19 @@ module BB
21
21
  # member_configs 项目成员工程配置
22
22
  # ignore_local_stable 是否忽略本地stable配置,true 适合pod子组件
23
23
  # skip_stable_check 是否跳过stable检测,true 采用标准pod合并操作
24
- def initialize(all_modules, member_modules = {}, member_configs = [], ignore_local_stable = false, skip_stable_check = false)
24
+ # ignore_dependencies_pod_names 过滤组件,不受stable版本控制
25
+ def initialize(all_modules, member_modules = {}, member_configs = [], ignore_local_stable = false, skip_stable_check = false, ignore_dependencies_pod_names=[])
25
26
  @source_manager = BB::SourceManager.new()
26
27
  #加载远程稳定仓库 和本地podfile 指定的仓库进行合并
27
28
  if skip_stable_check == true
28
29
  # 过滤带:remove数据
29
30
  @@all_modules = filter_origin_pod_modules(all_modules)
30
31
  else
31
- @@all_modules = load_stable_specs_to_podfile(all_modules, ignore_local_stable)
32
+ @@all_modules = load_stable_specs_to_podfile(all_modules, ignore_local_stable, ignore_dependencies_pod_names)
32
33
  end
33
34
  @@member_modules = member_modules
34
35
  @@member_configs = member_configs
36
+ @@ignore_dependencies_pod_names = ignore_dependencies_pod_names
35
37
  end
36
38
  private def filter_origin_pod_modules(all_modules)
37
39
  result_modules = []
@@ -100,8 +102,9 @@ module BB
100
102
 
101
103
  # 合并stable和podfile 中的specs! ⚠️podfile 中的组件会覆盖stable 中的!
102
104
  # 比如stable 中AFNetworking 指向标签1.1,而 podfile中AFNetworking 指向develop,那么最终AFNetworking 会指向develop
103
- def load_stable_specs_to_podfile(podfile_specs, ignore_local_stable = false)
105
+ def load_stable_specs_to_podfile(podfile_specs, ignore_local_stable = false, ignore_dependencies_pod_names=[])
104
106
  puts "[PodAssistant] start process pod module...".yellow
107
+ BB::DataConfig.config.set_ignore_dependencies_pod_names(ignore_dependencies_pod_names)
105
108
  local_stable_data = @source_manager.fetch_local_stable_datas # 本地stable配置
106
109
  if (local_stable_data.is_a? Hash) && !local_stable_data.empty?
107
110
  return merge_module_data(podfile_specs, local_stable_data)
@@ -54,11 +54,17 @@ module Pod
54
54
  source_manager.generate_pod_module_dependency(pod_names)
55
55
  end
56
56
  # pod组件合并操作(项目)
57
- def project_pod_module_run(pod_modules, member_modules = {}, member_configs = [], skip_stable_check = false)
57
+ # 参数说明
58
+ # all_modules 业务使用组件
59
+ # member_modules 项目成员模块,一般用于切本地开发使用
60
+ # member_configs 项目成员工程配置
61
+ # skip_stable_check 是否跳过stable检测,true 采用标准pod合并操作
62
+ # ignore_dependencies_pod_names 过滤组件,不受stable版本控制
63
+ def project_pod_module_run(pod_modules, member_modules = {}, member_configs = [], skip_stable_check = false, ignore_dependencies_pod_names=[])
58
64
  # Pod::UI.puts "Pod Module:#{pod_modules}"
59
65
  time1 = Time.new
60
66
  puts "[PodAssistant]项目pod组件组装开始操作时间:#{time1}".green
61
- source = BB::PodModule.new(pod_modules, member_modules, member_configs, false, skip_stable_check)
67
+ source = BB::PodModule.new(pod_modules, member_modules, member_configs, false, skip_stable_check, ignore_dependencies_pod_names)
62
68
  pod_box_module_run(source)
63
69
  time2 = Time.new
64
70
  puts "[PodAssistant]项目pod组件组装结束时间:#{time2}".green
@@ -67,11 +73,16 @@ module Pod
67
73
  puts "项目pod组件组装操作耗时:#{time.to_s.send(:red)}秒".green
68
74
  end
69
75
  # pod组件合并操作(单组件)
70
- def pod_module_run(pod_modules, member_modules = {}, member_configs = [])
76
+ # 参数说明
77
+ # all_modules 业务使用组件
78
+ # member_modules 项目成员模块,一般用于切本地开发使用
79
+ # member_configs 项目成员工程配置
80
+ # ignore_dependencies_pod_names 过滤组件,不受stable版本控制
81
+ def pod_module_run(pod_modules, member_modules = {}, member_configs = [], ignore_dependencies_pod_names=[])
71
82
  # Pod::UI.puts "Pod Module:#{pod_modules}"
72
83
  time1 = Time.new
73
84
  puts "[PodAssistant]pod组件组装开始操作时间:#{time1}".green
74
- source = BB::PodModule.new(pod_modules, member_modules, member_configs, true, true)
85
+ source = BB::PodModule.new(pod_modules, member_modules, member_configs, true, true, ignore_dependencies_pod_names)
75
86
  pod_box_module_run(source)
76
87
  time2 = Time.new
77
88
  puts "[PodAssistant]pod组件组装结束时间:#{time2}".green
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-PodAssistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6.1
4
+ version: 0.3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods-core
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.8.1
47
+ version: 0.2.9.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.8.1
54
+ version: 0.2.9.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fastlane
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.3'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -125,6 +125,7 @@ files:
125
125
  - lib/cocoapods-bb-PodAssistant/command/stable/sync.rb
126
126
  - lib/cocoapods-bb-PodAssistant/command/stable/update.rb
127
127
  - lib/cocoapods-bb-PodAssistant/config/cache_path.rb
128
+ - lib/cocoapods-bb-PodAssistant/config/data_config.rb
128
129
  - lib/cocoapods-bb-PodAssistant/config/source_manager.rb
129
130
  - lib/cocoapods-bb-PodAssistant/config/stable_source.rb
130
131
  - lib/cocoapods-bb-PodAssistant/config/stable_specs.rb
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
164
  requirements: []
164
- rubygems_version: 3.5.14
165
+ rubygems_version: 3.5.20
165
166
  signing_key:
166
167
  specification_version: 4
167
168
  summary: A longer description of cocoapods-bb-PodAssistant.