cocoapods-bb-bin 0.1.8 → 0.1.9.2

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: d6bfe1244ff7ee292516ac3f497b988ccfcc7db6cbed08617ec46dc2af558886
4
- data.tar.gz: 036b33803b77ebd6281ebe98639100fc8bb92c20f7448faec758a42ea2706e82
3
+ metadata.gz: d5f4829bed047a7e6cf24fa37682af5fc4dc8072f1007816fd4583c61905d05c
4
+ data.tar.gz: bec7974a90a79e8b5c6568603f754ede81499d5e1ddee4f2822b31acc2982839
5
5
  SHA512:
6
- metadata.gz: 4b3e12f0e1f5fac44c4fe96315838254ad4cb69b083c224d46a13782fad2537d78c73c88a0dffd6dda7f59e69c9183160a9d67fe9815f1e4fbc6f7187769b1e6
7
- data.tar.gz: 5d7e079146176eb2c0a9b68e4d2f68cf47286acb5d5a8dd8c81f4bb1a655c29a8981fb1bf6b322ebc47f067fa097aef4bce517b79cc8e276e66464ded1993b73
6
+ metadata.gz: c0defbc5c9f7cdfcca836b01ed21eab3af214eab878c1cbebe77e7089b6777f0b3a7e8f79af402c2bc3364ea8813d1eb56d2ee4415e9d84e211c57986c6fafbd
7
+ data.tar.gz: d4fa411c0be901eff6028216f351c3678e1f95be435afea6301e5dcd33aa89ddd0d242151d62f1e3850f52400aa365aaddf5a97040b5af097d8008138df23605
@@ -32,7 +32,7 @@ module Pod
32
32
  @env = argv.option('env') || 'dev'
33
33
  CBin.config.set_configuration_env(@env)
34
34
 
35
- podfile_path = link_podfile # 创建软链接
35
+ # podfile_path = link_podfile # 创建软链接 去除link操作 by hm 21/11/24
36
36
  @podspec = argv.shift_argument || find_podspec
37
37
  @specification = Specification.from_file(@podspec)
38
38
 
@@ -38,7 +38,6 @@ module Pod
38
38
  @podspec = argv.shift_argument
39
39
  super
40
40
  @additional_args = argv.remainder!
41
- @verbose = argv.flag?('verbose', false)
42
41
  end
43
42
 
44
43
  def run
@@ -109,11 +108,12 @@ module Pod
109
108
  argvs += ['--verbose'] if @verbose
110
109
  end
111
110
 
112
- # puts "pod lib lint argvs:#{argvs}"
111
+ puts "pod bin lib lint argvs:#{argvs}"
113
112
  lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
114
113
  lint.validate!
115
114
  lint.run
116
115
  rescue Object => exception
116
+ UI.puts "fail....."
117
117
  UI.puts exception
118
118
  end
119
119
  end
@@ -13,7 +13,8 @@ module Pod
13
13
  DESC
14
14
 
15
15
  self.arguments = [
16
- CLAide::Argument.new('NAME.podspec', false)
16
+ CLAide::Argument.new('REPO', true),
17
+ CLAide::Argument.new('NAME.podspec', false),
17
18
  ]
18
19
 
19
20
  def self.options
@@ -30,6 +31,7 @@ module Pod
30
31
  end
31
32
 
32
33
  def initialize(argv)
34
+ @repo = argv.shift_argument
33
35
  @podspec = argv.shift_argument
34
36
  @binary = argv.flag?('binary')
35
37
  @loose_options = argv.flag?('loose-options')
@@ -42,11 +44,6 @@ module Pod
42
44
  @bb_env = argv.flag?('bb-env', false)
43
45
  super
44
46
  @additional_args = argv.remainder!
45
- @message = argv.option('commit-message')
46
- @commit_message = argv.flag?('commit-message', false)
47
- @use_json = argv.flag?('use-json')
48
- @verbose = argv.flag?('verbose', false)
49
- @local_only = argv.flag?('local-only')
50
47
  end
51
48
 
52
49
  def run
@@ -99,11 +96,15 @@ module Pod
99
96
  end
100
97
  @podspec = podspecs.first
101
98
  end
99
+ new_repo = repo # 内部判断区源码还是二进制
100
+ if !@repo.nil?
101
+ new_repo = @repo # 使用命令传入
102
+ end
102
103
  argvs = [
103
- repo, # 内部判断区源码还是二进制
104
+ new_repo,
104
105
  @podspec,
105
106
  "--sources=#{sources_option(@code_dependencies, @sources)}",
106
- # '--verbose'
107
+ # '--verbose',
107
108
  '--allow-warnings',
108
109
  '--use-static-frameworks',
109
110
  '--skip-import-validation',
@@ -116,7 +117,7 @@ module Pod
116
117
  argvs += ['--use-json'] if @use_json
117
118
  argvs += ['--local-only'] if @local_only
118
119
 
119
- # UI.puts "pod repo push argvs:#{argvs}"
120
+ UI.puts "pod bin repo push argvs:#{argvs}"
120
121
  push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
121
122
  push.validate!
122
123
  push.run
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.9.2'
4
4
  end
5
5
 
6
6
  module Pod
@@ -73,14 +73,16 @@ EOF
73
73
  # 上传二进制 podspec
74
74
  def push_binary_repo(binary_podsepc_json)
75
75
  argvs = [
76
- "#{binary_podsepc_json}",
76
+ "#{binary_source.name}", # repo
77
+ "#{binary_podsepc_json}", # spec
77
78
  "--binary",
78
79
  "--sources=#{sources_option(@code_dependencies, @sources)},https:\/\/cdn.cocoapods.org",
79
80
  "--skip-import-validation",
80
81
  "--use-libraries",
81
82
  "--allow-warnings",
82
83
  "--verbose",
83
- "--code-dependencies"
84
+ "--code-dependencies",
85
+ '--no-cocoapods-validator', #不采用cocoapods验证
84
86
  ]
85
87
  if @verbose
86
88
  argvs += ['--verbose']
@@ -27,14 +27,15 @@ module Pod
27
27
  @skip_tests = argv.flag?('skip-tests', false)
28
28
  @allow_overwrite = argv.flag?('overwrite', true)
29
29
  super
30
+ @use_cocoapods_validator = argv.flag?('cocoapods-validator', true)# 配置参数cocoapods进行验证,内部进行hook,二进制hook,源码cocoapods进行验证
30
31
  end
31
32
 
32
33
  # Performs a full lint against the podspecs.
33
34
  #
34
35
  def validate_podspec_files
35
- UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
36
+ UI.puts "\nbin Validating #{'spec'.pluralize(count)}".yellow
36
37
  podspec_files.each do |podspec|
37
- validator = Validator.new(podspec, @source_urls)
38
+ validator = Validator.new(podspec, @source_urls, [], @use_cocoapods_validator)
38
39
  validator.allow_warnings = @allow_warnings
39
40
  validator.use_frameworks = @use_frameworks
40
41
  validator.use_static_frameworks = @use_static_frameworks
@@ -126,8 +126,8 @@ module Pod
126
126
  source = use_binary ? sources_manager.binary_source : sources_manager.code_source
127
127
 
128
128
  spec_version = rspec.spec.version
129
- UI.message 'cocoapods-bb-bin 插件'
130
- UI.message "- 开始处理 #{rspec.spec.name} #{spec_version} 组件."
129
+ # UI.message 'cocoapods-bb-bin 插件'
130
+ # UI.message "- 开始处理 #{rspec.spec.name} #{spec_version} 组件."
131
131
 
132
132
  begin
133
133
  # 从新 source 中获取 spec,在bin archive中会异常,因为找不到
@@ -0,0 +1,152 @@
1
+
2
+
3
+ module Pod
4
+ class Validator
5
+ # @return [Boolean] 使用cocoapods进行验证,二进制库推送默认不采用cocoapods(1.11.2)验证
6
+ #
7
+ # attr_accessor :use_cocoapods_validator
8
+ def initialize(spec_or_path, source_urls, platforms = [], use_cocoapods_validator = true)
9
+ @use_cocoapods_validator = use_cocoapods_validator
10
+ UI.puts "use_cocoapods_validator = #{use_cocoapods_validator}"
11
+ @use_frameworks = true
12
+ @linter = Specification::Linter.new(spec_or_path)
13
+ @source_urls = if @linter.spec && @linter.spec.dependencies.empty? && @linter.spec.recursive_subspecs.all? { |s| s.dependencies.empty? }
14
+ []
15
+ else
16
+ source_urls.map { |url| config.sources_manager.source_with_name_or_url(url) }.map(&:url)
17
+ end
18
+
19
+ @platforms = platforms.map do |platform|
20
+ result = case platform.to_s.downcase
21
+ # Platform doesn't recognize 'macos' as being the same as 'osx' when initializing
22
+ when 'macos' then Platform.macos
23
+ else Platform.new(platform, nil)
24
+ end
25
+ unless valid_platform?(result)
26
+ raise Informative, "Unrecognized platform `#{platform}`. Valid platforms: #{VALID_PLATFORMS.join(', ')}"
27
+ end
28
+ result
29
+ end
30
+ @use_frameworks = true
31
+ end
32
+
33
+ # Perform analysis for a given spec (or subspec)
34
+ #
35
+ def perform_extensive_analysis(spec)
36
+ if @use_cocoapods_validator
37
+ return cocoapods_perform_extensive_analysis(spec)
38
+ end
39
+ return true
40
+ end
41
+
42
+ #覆盖
43
+ def check_file_patterns
44
+ if @use_cocoapods_validator
45
+ cocoapods_check_file_patterns
46
+ return
47
+ end
48
+ # 二进制验证部分
49
+ FILE_PATTERNS.each do |attr_name|
50
+ next if %i(source_files resources).include? attr_name
51
+ if respond_to?("_validate_#{attr_name}", true)
52
+ send("_validate_#{attr_name}")
53
+ else
54
+ validate_nonempty_patterns(attr_name, :error)
55
+ end
56
+ end
57
+
58
+ _validate_header_mappings_dir
59
+ if consumer.spec.root?
60
+ _validate_license
61
+ _validate_module_map
62
+ end
63
+ end
64
+
65
+ def validate_source_url(spec)
66
+ if @use_cocoapods_validator
67
+ cocoapods_validate_source_url(spec)
68
+ return
69
+ end
70
+ end
71
+
72
+ # cocoapods(1.11.2) validator源码
73
+ private
74
+
75
+ # It checks that every file pattern specified in a spec yields
76
+ # at least one file. It requires the pods to be already present
77
+ # in the current working directory under Pods/spec.name.
78
+ #
79
+ # @return [void]
80
+ #
81
+ def cocoapods_check_file_patterns
82
+ FILE_PATTERNS.each do |attr_name|
83
+ if respond_to?("_validate_#{attr_name}", true)
84
+ send("_validate_#{attr_name}")
85
+ else
86
+ validate_nonempty_patterns(attr_name, :error)
87
+ end
88
+ end
89
+
90
+ _validate_header_mappings_dir
91
+ if consumer.spec.root?
92
+ _validate_license
93
+ _validate_module_map
94
+ end
95
+ end
96
+
97
+ # Performs validations related to the `source` -> `http` attribute (if exists)
98
+ #
99
+ def cocoapods_validate_source_url(spec)
100
+ return if spec.source.nil? || spec.source[:http].nil?
101
+ url = URI(spec.source[:http])
102
+ return if url.scheme == 'https' || url.scheme == 'file'
103
+ warning('http', "The URL (`#{url}`) doesn't use the encrypted HTTPS protocol. " \
104
+ 'It is crucial for Pods to be transferred over a secure protocol to protect your users from man-in-the-middle attacks. '\
105
+ 'This will be an error in future releases. Please update the URL to use https.')
106
+ end
107
+
108
+ # Perform analysis for a given spec (or subspec)
109
+ #
110
+ def cocoapods_perform_extensive_analysis(spec)
111
+ if spec.non_library_specification?
112
+ error('spec', "Validating a non library spec (`#{spec.name}`) is not supported.")
113
+ return false
114
+ end
115
+ validate_homepage(spec)
116
+ validate_screenshots(spec)
117
+ validate_social_media_url(spec)
118
+ validate_documentation_url(spec)
119
+ validate_source_url(spec)
120
+
121
+ platforms = platforms_to_lint(spec)
122
+
123
+ valid = platforms.send(fail_fast ? :all? : :each) do |platform|
124
+ UI.message "\n\n#{spec} - Analyzing on #{platform} platform.".green.reversed
125
+ @consumer = spec.consumer(platform)
126
+ setup_validation_environment
127
+ begin
128
+ create_app_project
129
+ download_pod
130
+ check_file_patterns
131
+ install_pod
132
+ validate_swift_version
133
+ add_app_project_import
134
+ validate_vendored_dynamic_frameworks
135
+ build_pod
136
+ test_pod unless skip_tests
137
+ ensure
138
+ tear_down_validation_environment
139
+ end
140
+ validated?
141
+ end
142
+ return false if fail_fast && !valid
143
+ perform_extensive_subspec_analysis(spec) unless @no_subspecs
144
+ rescue => e
145
+ message = e.to_s
146
+ message << "\n" << e.backtrace.join("\n") << "\n" if config.verbose?
147
+ error('unknown', "Encountered an unknown error (#{message}) during validation.")
148
+ false
149
+ end
150
+
151
+ end
152
+ end
@@ -12,7 +12,7 @@ if Pod.match_version?('~> 1.4')
12
12
  require 'cocoapods-bb-bin/native/linter'
13
13
  require 'cocoapods-bb-bin/native/resolver'
14
14
  require 'cocoapods-bb-bin/native/source'
15
- # require 'cocoapods-bb-bin/native/validator' #移除使用cocoapods默认自带
15
+ require 'cocoapods-bb-bin/native/validator' #使用cocoapods-1.11.2
16
16
  require 'cocoapods-bb-bin/native/acknowledgements'
17
17
  require 'cocoapods-bb-bin/native/sandbox_analyzer'
18
18
  require 'cocoapods-bb-bin/native/podspec_finder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-18 00:00:00.000000000 Z
11
+ date: 2021-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -173,6 +173,7 @@ files:
173
173
  - lib/cocoapods-bb-bin/native/sources_manager.rb
174
174
  - lib/cocoapods-bb-bin/native/specification.rb
175
175
  - lib/cocoapods-bb-bin/native/target_validator.rb
176
+ - lib/cocoapods-bb-bin/native/validator.rb
176
177
  - lib/cocoapods-bb-bin/source_provider_hook.rb
177
178
  - lib/cocoapods_plugin.rb
178
179
  - spec/command/bin_spec.rb