cocoapods-byte-panglem-beta 0.0.7 → 0.1.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: 1a6c5e75a80d0a83377d24e7bac384550441ec91d02856abe945c7527e3c7233
4
- data.tar.gz: 726fc89778286a3fba77cabe9fa8c3151a6f82acdc9abbb9072141c308fe5856
3
+ metadata.gz: 23449e54e253c3cafe117711e78d379d8c4b9a737b3c848fca62a20d4206f84e
4
+ data.tar.gz: b2e0c75ec1c77d6759903687040a4b650a2a04f509573e6c35a17d2f50121fac
5
5
  SHA512:
6
- metadata.gz: 749b4cd58cb1ee252c28a758db798e1593f4fb734d79d7e2f36bf67fc73073866fee79a3d1f77e9d569973c80b567e049708c65f23f6c0fd6281656b1c529a92
7
- data.tar.gz: e54778c794a191708f75c749e48d677ff53de82bb3dd85ffe1377f2f516cb03024cc4ea4dda463225613c9df65a9380dfcb74c1c333908b21db7dfc0c9f6fc28
6
+ metadata.gz: ef65d039055b866d2211fabfa56494860164599c9ae430364d1e9be1927b2bacf431df5cab809afb7b360565c6edce2d13482e847b10775f0d0b5d0221bd36bb
7
+ data.tar.gz: f877e822b9e93b039dd6d2255b59bbbf8254c9560dada1504f6ed35a0b65d627bca4fd021a5f1489df67ca19b3a1f1f77d2eafefbe55a6d8eed4ace746377171
@@ -25,29 +25,32 @@ module PM
25
25
  end
26
26
  result = UpdateResut.from_hash(hash)
27
27
  ## 校验Pangle SDK是否符合预期
28
- pm_spec = specs.find do |spec|
29
- result.sdk_name==Pod::Specification.root_name(spec.spec.name)
30
- end
31
- if pm_spec.nil?
32
- raise "[cocoapods-byte-panglem-beta][error] #{result.sdk_name} not found}"
33
- end
34
- if pm_spec.spec.version.version != result.sdk_original_version
35
- raise "[cocoapods-byte-panglem-beta][error] #{result.sdk_name} version has change(#{result.sdk_original_version}->#{pm_spec.spec.version.version}),After generating the Podfile.panglewe file, you may have made some changes in the podfile, causing the version of Pangle SDK to change. Please change 'use_pangm_sdk_update! :is_release => true
36
- ',delete':is_release => true' and re-execute 'pod install'"
37
- end
28
+ # pm_spec = specs.find do |spec|
29
+ # result.sdk_name==Pod::Specification.root_name(spec.spec.name)
30
+ # end
31
+ # if pm_spec.nil?
32
+ # raise "[cocoapods-byte-panglem-beta][error] #{result.sdk_name} not found}"
33
+ # end
34
+ # if pm_spec.spec.version.version != result.sdk_original_version
35
+ # raise "[cocoapods-byte-panglem-beta][error] #{result.sdk_name} version has change(#{result.sdk_original_version}->#{pm_spec.spec.version.version}),After generating the Podfile.panglewe file, you may have made some changes in the podfile, causing the version of Pangle SDK to change. Please change 'use_pangm_sdk_update! :is_release => true
36
+ # ',delete':is_release => true' and re-execute 'pod install'"
37
+ # end
38
38
  if result.is_sdk_update
39
39
  title_options = { :verbose_prefix => '-> '.green }
40
40
  Pod::UserInterface.titled_section("[cocoapods-byte-panglem-beta][info] will change pangle sdk version , the current version will change from #{result.sdk_original_version} to #{result.sdk_target_version}", title_options)
41
+ ## 先删掉现有的所有beta依赖 和 原有的ads_global依赖
41
42
  specs.delete_if{|spec|
42
- Pod::Specification.root_name(spec.spec.name) == result.sdk_name && spec.spec.version.version == result.sdk_original_version
43
+ Pod::Specification.root_name(spec.spec.name) == result.sdk_name or Pod::Specification.root_name(spec.spec.name) == PM::BuildConfig.pangle_sdk_release
43
44
  }
45
+ ## 再添加.pangle文件中记录的
44
46
  result.sdk_list.each{ |spec|
45
47
  specs << Pod::Resolver::ResolverSpecification.new(spec, false, spec.spec_source)
46
48
  }
47
49
 
48
50
  if result.is_rely_update
51
+
49
52
  specs.delete_if{|spec|
50
- Pod::Specification.root_name(spec.spec.name) == result.rely_name && spec.spec.version.version == result.rely_original_version
53
+ Pod::Specification.root_name(spec.spec.name) == result.rely_name
51
54
  }
52
55
  result.rely_list.each{ |spec|
53
56
  specs << Pod::Resolver::ResolverSpecification.new(spec, false, spec.spec_source)
@@ -114,6 +117,7 @@ module PM
114
117
  result = PM::SpecificationInfo.get_specfication response_data, sdk_spec
115
118
  ## 1. 判断sdk是否要更新, YES 则将旧的全部删除, 新的全部挂载
116
119
  ## 2. 判断rely 是否要更新, YES 则同上
120
+
117
121
  if result.is_sdk_update
118
122
  ## 这里截断,询问是否更新
119
123
  # cli = HighLine.new
@@ -130,6 +134,7 @@ module PM
130
134
  }
131
135
 
132
136
  if result.is_rely_update
137
+
133
138
  specs.delete_if{|spec|
134
139
  Pod::Specification.root_name(spec.spec.name) == result.rely_name && spec.spec.version.version == result.rely_original_version
135
140
  }
@@ -137,6 +142,11 @@ module PM
137
142
  specs << Pod::Resolver::ResolverSpecification.new(spec, false, spec.spec_source)
138
143
  }
139
144
  end
145
+ if result.is_rely_remove
146
+ specs.delete_if{|spec|
147
+ Pod::Specification.root_name(spec.spec.name) == result.rely_name && spec.spec.version.version == result.rely_original_version
148
+ }
149
+ end
140
150
  specs.sort_by!{|spec| spec.spec.name}
141
151
  is_update_finish = true
142
152
  request_track result.sdk_original_version, result.sdk_target_version, result.sdk_target_version, response_data["code"], response_data["message"]
@@ -2,7 +2,7 @@
2
2
  ##SPDX-License-Identifier: MIT
3
3
 
4
4
  module CocoapodsBytePanglem
5
- VERSION = "0.0.7"
5
+ VERSION = "0.1.0"
6
6
  class Version
7
7
  def self.version
8
8
  VERSION
@@ -37,7 +37,7 @@ module PM
37
37
  end
38
38
 
39
39
  def Network.request_adapter(body, is_debug = false)
40
- if is_debug
40
+ if false
41
41
  url = URI.parse('http://localhost:8080/index.html')
42
42
  http = Net::HTTP.new(url.host, url.port)
43
43
  request = Net::HTTP::Get.new(url.path, initheader = {'Content-Type' =>'application/json'})
@@ -78,7 +78,7 @@ class Pod::Installer::Analyzer
78
78
  specs.each do |s|
79
79
  s.dependencies(platform).each do |dep|
80
80
  temp_name = dep.name
81
- if !temp_name.include?("Ads-Global/")
81
+ if !temp_name.include?("Ads-Global")
82
82
  all_specs[dep.name].each do |spec|
83
83
  if spec.non_library_specification?
84
84
  if s.test_specification? && spec.name == s.consumer(platform).app_host_name && spec.app_specification?
@@ -108,10 +108,6 @@ class Pod::Installer::Analyzer
108
108
  resolver_specs_by_target.each do |target, specs|
109
109
 
110
110
  if specs.length > 0
111
- ## SDK 场景下 不需要
112
- # Pod::UserInterface.section 'cocoapods-byte-panglem remove invalid dependencie from loaded dependencies ' do
113
- # PM::Analyzer.delete_invalid_adapters target, specs
114
- # end if PM::Recorder.instance.get_global_note.auto_load
115
111
 
116
112
  if PM::Recorder.instance.is_release
117
113
  Pod::UserInterface.section "[cocoapods-byte-panglem-beta][info] start trying to update the sdk version (when is_release is yes) " do
@@ -159,9 +155,6 @@ module Pod
159
155
  when Hash
160
156
  PM::Recorder.instance.set_is_debug options[:is_debug] if options.has_key?(:is_debug)
161
157
  PM::Recorder.instance.set_is_auto_update options[:is_auto_update]if options.has_key?(:is_auto_update)
162
- m = PM::Recorder.instance.is_debug
163
- n = PM::Recorder.instance.is_auto_update
164
- c = 1
165
158
  end
166
159
 
167
160
  PMPlugin.update
@@ -5,6 +5,8 @@ require 'cocoapods'
5
5
  require_relative 'net'
6
6
  require_relative 'config'
7
7
  require_relative 'tool'
8
+ require 'rubygems/version'
9
+
8
10
 
9
11
 
10
12
 
@@ -195,6 +197,7 @@ module PM
195
197
  class UpdateResut
196
198
  attr_accessor :is_sdk_update
197
199
  attr_accessor :is_rely_update
200
+ attr_accessor :is_rely_remove
198
201
  attr_accessor :sdk_list
199
202
  attr_accessor :rely_list
200
203
  attr_accessor :sdk_name
@@ -213,7 +216,7 @@ module PM
213
216
 
214
217
  def self.from_hash(hash)
215
218
  re = UpdateResut.new()
216
- re.sdk_name = "Ads-Global"
219
+ re.sdk_name = PM::BuildConfig.pangle_sdk_beta
217
220
  re.rely_name = "BURelyFoundation_Global"
218
221
  re.sdk_original_version = hash["SDK_ORIGINAL_VERSION"]
219
222
  re.sdk_target_version = hash["SDK_TARGET_VERSION"]
@@ -432,10 +435,12 @@ module PM
432
435
  ## 3. 计算出升级时需要替换的所有的specfication
433
436
  info_r = get_info
434
437
  target_sdk_version = response_data["data"]["pangle_sdk_version"]
438
+ original_sdk_version = original_sdk_spec.spec.version.version
439
+
435
440
  # target_sdk_version = "5.9.0.4"
436
441
  sdk_name = PM::BuildConfig.pangle_sdk_beta
437
442
  if target_sdk_version == nil || target_sdk_version.length == 0
438
- ## 兜底, 赋值为当前版本且为正式版
443
+ ## 赋值为当前版本且为正式版
439
444
  target_sdk_version = original_sdk_spec.spec.version.version
440
445
  sdk_name = PM::BuildConfig.pangle_sdk_release
441
446
  else
@@ -461,20 +466,42 @@ module PM
461
466
  result.sdk_target_version = target_sdk_root_spec.version.version
462
467
  PM::Recorder.instance.sdk_original_version = result.sdk_original_version
463
468
  PM::Recorder.instance.sdk_target_version = result.sdk_target_version
464
- target_rely_version = target_sdk_root_spec.get_rely_version
465
- original_rely_version = original_sdk_spec.spec.get_rely_version
469
+ target_rely_version = "0.0.0.0"
470
+ original_rely_version = "0.0.0.0"
471
+ if Gem::Version.new(target_sdk_version) < Gem::Version.new("6.3.0.0")
472
+ target_rely_version = target_sdk_root_spec.get_rely_version
473
+ end
474
+ if Gem::Version.new(original_sdk_version) < Gem::Version.new("6.3.0.0")
475
+ original_rely_version = original_sdk_spec.spec.get_rely_version
476
+ end
477
+
478
+
466
479
  # target_rely_version = "0.2.0.0"
467
- if target_rely_version != original_rely_version
468
- target_rely_spec_list = info_r[rely_name].select do |spec|
469
- Pod::Specification.root_name(spec.name) == rely_name && spec.version.version == target_rely_version
470
- end
471
- result.is_rely_update = true
472
- result.rely_list = target_rely_spec_list
480
+ ## 判断灰度目标版本是否>=6300, 大于等于 则删除rely的依赖
481
+ if Gem::Version.new(target_sdk_version) >= Gem::Version.new("6.3.0.0")
482
+ result.is_rely_remove = true;
483
+ result.is_rely_update = false
484
+ result.rely_list = []
473
485
  result.rely_original_version = original_rely_version
474
486
  result.rely_target_version = target_rely_version
475
487
  PM::Recorder.instance.rely_original_version = result.rely_original_version
476
488
  PM::Recorder.instance.rely_target_version = result.rely_target_version
489
+ else
490
+
491
+ if target_rely_version != original_rely_version
492
+ target_rely_spec_list = info_r[rely_name].select do |spec|
493
+ Pod::Specification.root_name(spec.name) == rely_name && spec.version.version == target_rely_version
494
+ end
495
+ result.is_rely_remove = false;
496
+ result.is_rely_update = true
497
+ result.rely_list = target_rely_spec_list
498
+ result.rely_original_version = original_rely_version
499
+ result.rely_target_version = target_rely_version
500
+ PM::Recorder.instance.rely_original_version = result.rely_original_version
501
+ PM::Recorder.instance.rely_target_version = result.rely_target_version
502
+ end
477
503
  end
504
+
478
505
  end
479
506
  result
480
507
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-byte-panglem-beta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhangtianhao.1230@bytedance.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-23 00:00:00.000000000 Z
11
+ date: 2024-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods