cocoapods-byte-panglem-beta 0.0.8 → 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: 06c8be5834db737add654116e99da3122c88dabffd447d099a06acc72dd4b17d
4
- data.tar.gz: 5cca827e8ca7b528db58960779192c117f7883497f897c3c5c85513b57632c84
3
+ metadata.gz: 23449e54e253c3cafe117711e78d379d8c4b9a737b3c848fca62a20d4206f84e
4
+ data.tar.gz: b2e0c75ec1c77d6759903687040a4b650a2a04f509573e6c35a17d2f50121fac
5
5
  SHA512:
6
- metadata.gz: 98cab214b9d7e8b38ba609fb41329ec6c21e2cec31f4df3954eada8f025dee343d06896889c8d9524617c4ebd927dbfd661f90f0233ed14bc465b9d1f522eccb
7
- data.tar.gz: af2ef6c20e293e234d51bbe4bff48d0b701f0ab5c72f5e9b367ce2ddea657d000c3ba23bc2ca37c57369f08ed41d5b940aa7cb5d7a7bd14761d472a3a3eb17ff
6
+ metadata.gz: ef65d039055b866d2211fabfa56494860164599c9ae430364d1e9be1927b2bacf431df5cab809afb7b360565c6edce2d13482e847b10775f0d0b5d0221bd36bb
7
+ data.tar.gz: f877e822b9e93b039dd6d2255b59bbbf8254c9560dada1504f6ed35a0b65d627bca4fd021a5f1489df67ca19b3a1f1f77d2eafefbe55a6d8eed4ace746377171
@@ -117,6 +117,7 @@ module PM
117
117
  result = PM::SpecificationInfo.get_specfication response_data, sdk_spec
118
118
  ## 1. 判断sdk是否要更新, YES 则将旧的全部删除, 新的全部挂载
119
119
  ## 2. 判断rely 是否要更新, YES 则同上
120
+
120
121
  if result.is_sdk_update
121
122
  ## 这里截断,询问是否更新
122
123
  # cli = HighLine.new
@@ -133,6 +134,7 @@ module PM
133
134
  }
134
135
 
135
136
  if result.is_rely_update
137
+
136
138
  specs.delete_if{|spec|
137
139
  Pod::Specification.root_name(spec.spec.name) == result.rely_name && spec.spec.version.version == result.rely_original_version
138
140
  }
@@ -140,6 +142,11 @@ module PM
140
142
  specs << Pod::Resolver::ResolverSpecification.new(spec, false, spec.spec_source)
141
143
  }
142
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
143
150
  specs.sort_by!{|spec| spec.spec.name}
144
151
  is_update_finish = true
145
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.8"
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
@@ -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.8
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-24 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