cocoapods-bb-bin 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-bb-bin/command/bin/lib/lint.rb +78 -21
- data/lib/cocoapods-bb-bin/command/bin/repo/push.rb +169 -0
- data/lib/cocoapods-bb-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bb-bin/helpers/upload_helper.rb +1 -1
- data/lib/cocoapods-bb-bin/native/push.rb +59 -0
- data/lib/cocoapods-bb-bin/native.rb +2 -1
- metadata +4 -4
- data/lib/cocoapods-bb-bin/command/bin/spec/push.rb +0 -114
- data/lib/cocoapods-bb-bin/native/validator.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6bfe1244ff7ee292516ac3f497b988ccfcc7db6cbed08617ec46dc2af558886
|
4
|
+
data.tar.gz: 036b33803b77ebd6281ebe98639100fc8bb92c20f7448faec758a42ea2706e82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b3e12f0e1f5fac44c4fe96315838254ad4cb69b083c224d46a13782fad2537d78c73c88a0dffd6dda7f59e69c9183160a9d67fe9815f1e4fbc6f7187769b1e6
|
7
|
+
data.tar.gz: 5d7e079146176eb2c0a9b68e4d2f68cf47286acb5d5a8dd8c81f4bb1a655c29a8981fb1bf6b322ebc47f067fa097aef4bce517b79cc8e276e66464ded1993b73
|
@@ -1,18 +1,21 @@
|
|
1
1
|
require 'cocoapods-bb-bin/config/config'
|
2
2
|
require 'cocoapods-bb-bin/native/podfile'
|
3
|
+
require 'cocoapods/command/lib/lint'
|
4
|
+
require 'cocoapods'
|
3
5
|
|
4
6
|
module Pod
|
5
7
|
class Command
|
6
8
|
class Bin < Command
|
7
9
|
class Lib < Bin
|
8
10
|
class Lint < Lib
|
9
|
-
self.summary = '
|
11
|
+
self.summary = 'Validates a Pod'
|
12
|
+
|
10
13
|
self.description = <<-DESC
|
11
|
-
|
14
|
+
Validates the Pod using the files in the working directory.
|
12
15
|
DESC
|
13
16
|
|
14
17
|
self.arguments = [
|
15
|
-
CLAide::Argument.new('NAME.podspec', false)
|
18
|
+
CLAide::Argument.new('NAME.podspec', false),
|
16
19
|
]
|
17
20
|
|
18
21
|
# lib lint 不会下载 source,所以不能进行二进制 lint
|
@@ -21,46 +24,100 @@ module Pod
|
|
21
24
|
[
|
22
25
|
['--code-dependencies', '使用源码依赖进行 lint'],
|
23
26
|
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
24
|
-
['--allow-prerelease', '允许使用 prerelease 的版本 lint']
|
27
|
+
['--allow-prerelease', '允许使用 prerelease 的版本 lint'],
|
28
|
+
['--bb-env', 'bb Company environment(Internal use),support oc、swift project']
|
25
29
|
].concat(Pod::Command::Lib::Lint.options).concat(super).uniq
|
26
30
|
end
|
27
31
|
|
28
32
|
def initialize(argv)
|
29
33
|
@loose_options = argv.flag?('loose-options')
|
30
|
-
@code_dependencies = argv.flag?('code-dependencies')
|
34
|
+
@code_dependencies = argv.flag?('code-dependencies', true)
|
31
35
|
@sources = argv.option('sources') || []
|
32
36
|
@allow_prerelease = argv.flag?('allow-prerelease')
|
37
|
+
@bb_env = argv.flag?('bb-env', false)
|
33
38
|
@podspec = argv.shift_argument
|
34
39
|
super
|
35
|
-
|
36
40
|
@additional_args = argv.remainder!
|
41
|
+
@verbose = argv.flag?('verbose', false)
|
37
42
|
end
|
38
43
|
|
39
44
|
def run
|
40
|
-
|
41
|
-
|
45
|
+
# @bb_env = false
|
46
|
+
if @bb_env
|
47
|
+
Podfile.execute_with_bin_plugin do
|
42
48
|
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
build_bb_lint
|
50
|
+
end
|
51
|
+
end
|
52
|
+
else
|
53
|
+
Podfile.execute_with_bin_plugin do
|
54
|
+
Podfile.execute_with_allow_prerelease(@allow_prerelease) do
|
55
|
+
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
56
|
+
argvs = [
|
57
|
+
@podspec || code_spec_files.first,
|
58
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
59
|
+
*@additional_args
|
60
|
+
]
|
48
61
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
62
|
+
if @loose_options
|
63
|
+
argvs << '--allow-warnings'
|
64
|
+
if code_spec&.all_dependencies&.any?
|
65
|
+
argvs << '--use-libraries'
|
66
|
+
end
|
53
67
|
end
|
54
|
-
end
|
55
68
|
|
56
|
-
|
57
|
-
|
58
|
-
|
69
|
+
lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
|
70
|
+
lint.validate!
|
71
|
+
lint.run
|
72
|
+
end
|
59
73
|
end
|
60
74
|
end
|
61
75
|
end
|
62
76
|
end
|
63
77
|
|
78
|
+
private
|
79
|
+
|
80
|
+
def build_bb_lint
|
81
|
+
UI.section("\npod bin lib lint\n".yellow) do
|
82
|
+
begin
|
83
|
+
if @podspec && !@podspec.empty?
|
84
|
+
argvs = [
|
85
|
+
@podspec, # 业务方传入podspec,对于业务方没有传入podspec,内部由podspecs_to_lint进行遍历
|
86
|
+
# '--verbose',
|
87
|
+
'--allow-warnings',
|
88
|
+
'--use-static-frameworks',
|
89
|
+
'--no-clean',
|
90
|
+
'--skip-import-validation',
|
91
|
+
'--use-modular-headers',
|
92
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
93
|
+
'--swift-version=5.0',
|
94
|
+
*@additional_args
|
95
|
+
]
|
96
|
+
argvs += ['--verbose'] if @verbose
|
97
|
+
else
|
98
|
+
argvs = [
|
99
|
+
# '--verbose',
|
100
|
+
'--allow-warnings',
|
101
|
+
'--use-static-frameworks',
|
102
|
+
'--no-clean',
|
103
|
+
'--skip-import-validation',
|
104
|
+
'--use-modular-headers',
|
105
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
106
|
+
'--swift-version=5.0',
|
107
|
+
*@additional_args
|
108
|
+
]
|
109
|
+
argvs += ['--verbose'] if @verbose
|
110
|
+
end
|
111
|
+
|
112
|
+
# puts "pod lib lint argvs:#{argvs}"
|
113
|
+
lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
|
114
|
+
lint.validate!
|
115
|
+
lint.run
|
116
|
+
rescue Object => exception
|
117
|
+
UI.puts exception
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
64
121
|
|
65
122
|
end
|
66
123
|
end
|
@@ -0,0 +1,169 @@
|
|
1
|
+
require 'cocoapods-bb-bin/config/config'
|
2
|
+
require 'cocoapods-bb-bin/native/podfile'
|
3
|
+
require 'cocoapods-bb-bin/native/push'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
class Command
|
7
|
+
class Bin < Command
|
8
|
+
class Repo < Bin
|
9
|
+
class Push < Repo
|
10
|
+
self.summary = '发布组件.'
|
11
|
+
self.description = <<-DESC
|
12
|
+
发布二进制组件 / 源码组件
|
13
|
+
DESC
|
14
|
+
|
15
|
+
self.arguments = [
|
16
|
+
CLAide::Argument.new('NAME.podspec', false)
|
17
|
+
]
|
18
|
+
|
19
|
+
def self.options
|
20
|
+
[
|
21
|
+
['--binary', '发布组件的二进制版本'],
|
22
|
+
['--template-podspec=A.binary-template.podspec', '生成拥有 subspec 的二进制 spec 需要的模版 podspec, 插件会更改 version 和 source'],
|
23
|
+
['--reserve-created-spec', '保留生成的二进制 spec 文件'],
|
24
|
+
['--code-dependencies', '使用源码依赖进行 lint'],
|
25
|
+
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
26
|
+
['--allow-prerelease', '允许使用 prerelease 的版本 lint'],
|
27
|
+
['--use-static-frameworks', 'Lint uses static frameworks during installation,support modulemap'],
|
28
|
+
['--bb-env', 'bb Company environment(Internal use),support oc、swift project']
|
29
|
+
].concat(Pod::Command::Repo::Push.options).concat(super).uniq
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize(argv)
|
33
|
+
@podspec = argv.shift_argument
|
34
|
+
@binary = argv.flag?('binary')
|
35
|
+
@loose_options = argv.flag?('loose-options')
|
36
|
+
@code_dependencies = argv.flag?('code-dependencies', true)
|
37
|
+
@sources = argv.option('sources') || []
|
38
|
+
@reserve_created_spec = argv.flag?('reserve-created-spec')
|
39
|
+
@template_podspec = argv.option('template-podspec')
|
40
|
+
@allow_prerelease = argv.flag?('allow-prerelease')
|
41
|
+
@use_static_frameworks = argv.flag?('use-static-frameworks', true)
|
42
|
+
@bb_env = argv.flag?('bb-env', false)
|
43
|
+
super
|
44
|
+
@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
|
+
end
|
51
|
+
|
52
|
+
def run
|
53
|
+
# @bb_env = false
|
54
|
+
if @bb_env
|
55
|
+
Podfile.execute_with_bin_plugin do
|
56
|
+
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
57
|
+
build_bb_push
|
58
|
+
end
|
59
|
+
end
|
60
|
+
else
|
61
|
+
Podfile.execute_with_bin_plugin do
|
62
|
+
Podfile.execute_with_allow_prerelease(@allow_prerelease) do
|
63
|
+
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
64
|
+
argvs = [
|
65
|
+
repo,
|
66
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
67
|
+
*@additional_args
|
68
|
+
]
|
69
|
+
|
70
|
+
argvs << spec_file if spec_file
|
71
|
+
|
72
|
+
if @loose_options
|
73
|
+
argvs += ['--allow-warnings', '--use-json']
|
74
|
+
if code_spec&.all_dependencies&.any?
|
75
|
+
argvs << '--use-libraries'
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
80
|
+
push.validate!
|
81
|
+
push.run
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
ensure
|
87
|
+
clear_binary_spec_file_if_needed unless @reserve_created_spec
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
def build_bb_push
|
92
|
+
UI.section("\npod bin repo push\n".yellow) do
|
93
|
+
begin
|
94
|
+
unless @podspec && !@podspec.empty? # 遍历当前目录下podspec文件
|
95
|
+
podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.json,}')
|
96
|
+
if podspecs.count.zero?
|
97
|
+
raise Informative, 'Unable to find a podspec in the working ' \
|
98
|
+
'directory'
|
99
|
+
end
|
100
|
+
@podspec = podspecs.first
|
101
|
+
end
|
102
|
+
argvs = [
|
103
|
+
repo, # 内部判断区源码还是二进制
|
104
|
+
@podspec,
|
105
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
106
|
+
# '--verbose'
|
107
|
+
'--allow-warnings',
|
108
|
+
'--use-static-frameworks',
|
109
|
+
'--skip-import-validation',
|
110
|
+
'--use-modular-headers',
|
111
|
+
'--swift-version=5.0',
|
112
|
+
*@additional_args
|
113
|
+
]
|
114
|
+
argvs += ['--verbose'] if @verbose
|
115
|
+
argvs += ['--commit-message'] if @message
|
116
|
+
argvs += ['--use-json'] if @use_json
|
117
|
+
argvs += ['--local-only'] if @local_only
|
118
|
+
|
119
|
+
# UI.puts "pod repo push argvs:#{argvs}"
|
120
|
+
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
121
|
+
push.validate!
|
122
|
+
push.run
|
123
|
+
rescue Object => exception
|
124
|
+
UI.puts exception
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def template_spec_file
|
130
|
+
@template_spec_file ||= begin
|
131
|
+
if @template_podspec
|
132
|
+
find_spec_file(@template_podspec)
|
133
|
+
else
|
134
|
+
binary_template_spec_file
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def spec_file
|
140
|
+
@spec_file ||= begin
|
141
|
+
if @podspec
|
142
|
+
find_spec_file(@podspec)
|
143
|
+
else
|
144
|
+
if code_spec_files.empty?
|
145
|
+
raise Informative, '当前目录下没有找到可用源码 podspec.'
|
146
|
+
end
|
147
|
+
|
148
|
+
spec_file = if @binary
|
149
|
+
code_spec = Pod::Specification.from_file(code_spec_files.first)
|
150
|
+
if template_spec_file
|
151
|
+
template_spec = Pod::Specification.from_file(template_spec_file)
|
152
|
+
end
|
153
|
+
create_binary_spec_file(code_spec, template_spec)
|
154
|
+
else
|
155
|
+
code_spec_files.first
|
156
|
+
end
|
157
|
+
spec_file
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def repo
|
163
|
+
@binary ? binary_source.name : code_source.name
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -8,7 +8,7 @@ require 'cocoapods/generate'
|
|
8
8
|
require 'cocoapods-bb-bin/helpers/framework_builder'
|
9
9
|
require 'cocoapods-bb-bin/helpers/library_builder'
|
10
10
|
require 'cocoapods-bb-bin/helpers/sources_helper'
|
11
|
-
require 'cocoapods-bb-bin/command/bin/
|
11
|
+
require 'cocoapods-bb-bin/command/bin/repo/push'
|
12
12
|
|
13
13
|
module CBin
|
14
14
|
class Upload
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
4
|
+
|
5
|
+
module Pod
|
6
|
+
class Command
|
7
|
+
class Repo < Command
|
8
|
+
class Push < Repo
|
9
|
+
|
10
|
+
def initialize(argv)
|
11
|
+
@allow_warnings = argv.flag?('allow-warnings')
|
12
|
+
@local_only = argv.flag?('local-only')
|
13
|
+
@repo = argv.shift_argument
|
14
|
+
@source = source_for_repo
|
15
|
+
@source_urls = argv.option('sources', config.sources_manager.all.map(&:url).append(Pod::TrunkSource::TRUNK_REPO_URL).uniq.join(',')).split(',')
|
16
|
+
@update_sources = argv.flag?('update-sources')
|
17
|
+
@podspec = argv.shift_argument
|
18
|
+
@use_frameworks = !argv.flag?('use-libraries')
|
19
|
+
@use_modular_headers = argv.flag?('use-modular-headers', false)
|
20
|
+
@use_static_frameworks = argv.flag?('use-static-frameworks')
|
21
|
+
@private = argv.flag?('private', true)
|
22
|
+
@message = argv.option('commit-message')
|
23
|
+
@commit_message = argv.flag?('commit-message', false)
|
24
|
+
@use_json = argv.flag?('use-json')
|
25
|
+
@swift_version = argv.option('swift-version', nil)
|
26
|
+
@skip_import_validation = argv.flag?('skip-import-validation', false)
|
27
|
+
@skip_tests = argv.flag?('skip-tests', false)
|
28
|
+
@allow_overwrite = argv.flag?('overwrite', true)
|
29
|
+
super
|
30
|
+
end
|
31
|
+
|
32
|
+
# Performs a full lint against the podspecs.
|
33
|
+
#
|
34
|
+
def validate_podspec_files
|
35
|
+
UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
|
36
|
+
podspec_files.each do |podspec|
|
37
|
+
validator = Validator.new(podspec, @source_urls)
|
38
|
+
validator.allow_warnings = @allow_warnings
|
39
|
+
validator.use_frameworks = @use_frameworks
|
40
|
+
validator.use_static_frameworks = @use_static_frameworks
|
41
|
+
validator.use_modular_headers = @use_modular_headers
|
42
|
+
validator.ignore_public_only_results = @private
|
43
|
+
validator.swift_version = @swift_version
|
44
|
+
validator.skip_import_validation = @skip_import_validation
|
45
|
+
validator.skip_tests = @skip_tests
|
46
|
+
begin
|
47
|
+
validator.validate
|
48
|
+
rescue => e
|
49
|
+
raise Informative, "The `#{podspec}` specification does not validate." \
|
50
|
+
"\n\n#{e.message}"
|
51
|
+
end
|
52
|
+
raise Informative, "The `#{podspec}` specification does not validate." unless validator.validated?
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -12,12 +12,13 @@ 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'
|
15
|
+
# require 'cocoapods-bb-bin/native/validator' #移除使用cocoapods默认自带
|
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'
|
19
19
|
require 'cocoapods-bb-bin/native/file_accessor'
|
20
20
|
require 'cocoapods-bb-bin/native/pod_target_installer'
|
21
21
|
require 'cocoapods-bb-bin/native/target_validator'
|
22
|
+
require 'cocoapods-bb-bin/native/push' # 支持modulemap & swift与oc工程混编
|
22
23
|
|
23
24
|
end
|
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.
|
4
|
+
version: 0.1.8
|
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-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -128,9 +128,9 @@ files:
|
|
128
128
|
- lib/cocoapods-bb-bin/command/bin/initHotKey.rb
|
129
129
|
- lib/cocoapods-bb-bin/command/bin/install.rb
|
130
130
|
- lib/cocoapods-bb-bin/command/bin/lib/lint.rb
|
131
|
+
- lib/cocoapods-bb-bin/command/bin/repo/push.rb
|
131
132
|
- lib/cocoapods-bb-bin/command/bin/repo/update.rb
|
132
133
|
- lib/cocoapods-bb-bin/command/bin/spec/create.rb
|
133
|
-
- lib/cocoapods-bb-bin/command/bin/spec/push.rb
|
134
134
|
- lib/cocoapods-bb-bin/command/bin/update.rb
|
135
135
|
- lib/cocoapods-bb-bin/config/config.rb
|
136
136
|
- lib/cocoapods-bb-bin/config/config_asker.rb
|
@@ -166,13 +166,13 @@ files:
|
|
166
166
|
- lib/cocoapods-bb-bin/native/podfile_env.rb
|
167
167
|
- lib/cocoapods-bb-bin/native/podfile_generator.rb
|
168
168
|
- lib/cocoapods-bb-bin/native/podspec_finder.rb
|
169
|
+
- lib/cocoapods-bb-bin/native/push.rb
|
169
170
|
- lib/cocoapods-bb-bin/native/resolver.rb
|
170
171
|
- lib/cocoapods-bb-bin/native/sandbox_analyzer.rb
|
171
172
|
- lib/cocoapods-bb-bin/native/source.rb
|
172
173
|
- lib/cocoapods-bb-bin/native/sources_manager.rb
|
173
174
|
- lib/cocoapods-bb-bin/native/specification.rb
|
174
175
|
- lib/cocoapods-bb-bin/native/target_validator.rb
|
175
|
-
- lib/cocoapods-bb-bin/native/validator.rb
|
176
176
|
- lib/cocoapods-bb-bin/source_provider_hook.rb
|
177
177
|
- lib/cocoapods_plugin.rb
|
178
178
|
- spec/command/bin_spec.rb
|
@@ -1,114 +0,0 @@
|
|
1
|
-
require 'cocoapods-bb-bin/config/config'
|
2
|
-
require 'cocoapods-bb-bin/native/podfile'
|
3
|
-
|
4
|
-
module Pod
|
5
|
-
class Command
|
6
|
-
class Bin < Command
|
7
|
-
class Repo < Bin
|
8
|
-
class Push < Repo
|
9
|
-
self.summary = '发布组件.'
|
10
|
-
self.description = <<-DESC
|
11
|
-
发布二进制组件 / 源码组件
|
12
|
-
DESC
|
13
|
-
|
14
|
-
self.arguments = [
|
15
|
-
CLAide::Argument.new('NAME.podspec', false)
|
16
|
-
]
|
17
|
-
|
18
|
-
def self.options
|
19
|
-
[
|
20
|
-
['--binary', '发布组件的二进制版本'],
|
21
|
-
['--template-podspec=A.binary-template.podspec', '生成拥有 subspec 的二进制 spec 需要的模版 podspec, 插件会更改 version 和 source'],
|
22
|
-
['--reserve-created-spec', '保留生成的二进制 spec 文件'],
|
23
|
-
['--code-dependencies', '使用源码依赖进行 lint'],
|
24
|
-
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
25
|
-
['--allow-prerelease', '允许使用 prerelease 的版本 lint']
|
26
|
-
].concat(Pod::Command::Repo::Push.options).concat(super).uniq
|
27
|
-
end
|
28
|
-
|
29
|
-
def initialize(argv)
|
30
|
-
@podspec = argv.shift_argument
|
31
|
-
@binary = argv.flag?('binary')
|
32
|
-
@loose_options = argv.flag?('loose-options')
|
33
|
-
@code_dependencies = argv.flag?('code-dependencies')
|
34
|
-
@sources = argv.option('sources') || []
|
35
|
-
@reserve_created_spec = argv.flag?('reserve-created-spec')
|
36
|
-
@template_podspec = argv.option('template-podspec')
|
37
|
-
@allow_prerelease = argv.flag?('allow-prerelease')
|
38
|
-
super
|
39
|
-
|
40
|
-
@additional_args = argv.remainder!
|
41
|
-
end
|
42
|
-
|
43
|
-
def run
|
44
|
-
Podfile.execute_with_bin_plugin do
|
45
|
-
Podfile.execute_with_allow_prerelease(@allow_prerelease) do
|
46
|
-
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
47
|
-
argvs = [
|
48
|
-
repo,
|
49
|
-
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
50
|
-
*@additional_args
|
51
|
-
]
|
52
|
-
|
53
|
-
argvs << spec_file if spec_file
|
54
|
-
|
55
|
-
if @loose_options
|
56
|
-
argvs += ['--allow-warnings', '--use-json']
|
57
|
-
if code_spec&.all_dependencies&.any?
|
58
|
-
argvs << '--use-libraries'
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
63
|
-
push.validate!
|
64
|
-
push.run
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
ensure
|
69
|
-
clear_binary_spec_file_if_needed unless @reserve_created_spec
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
def template_spec_file
|
75
|
-
@template_spec_file ||= begin
|
76
|
-
if @template_podspec
|
77
|
-
find_spec_file(@template_podspec)
|
78
|
-
else
|
79
|
-
binary_template_spec_file
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def spec_file
|
85
|
-
@spec_file ||= begin
|
86
|
-
if @podspec
|
87
|
-
find_spec_file(@podspec)
|
88
|
-
else
|
89
|
-
if code_spec_files.empty?
|
90
|
-
raise Informative, '当前目录下没有找到可用源码 podspec.'
|
91
|
-
end
|
92
|
-
|
93
|
-
spec_file = if @binary
|
94
|
-
code_spec = Pod::Specification.from_file(code_spec_files.first)
|
95
|
-
if template_spec_file
|
96
|
-
template_spec = Pod::Specification.from_file(template_spec_file)
|
97
|
-
end
|
98
|
-
create_binary_spec_file(code_spec, template_spec)
|
99
|
-
else
|
100
|
-
code_spec_files.first
|
101
|
-
end
|
102
|
-
spec_file
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def repo
|
108
|
-
@binary ? binary_source.name : code_source.name
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Pod
|
4
|
-
class Validator
|
5
|
-
# def validate_source_url(spec)
|
6
|
-
# return if spec.source.nil? || spec.source[:http].nil?
|
7
|
-
# url = URI(spec.source[:http])
|
8
|
-
# return if url.scheme == 'https' || url.scheme == 'file'
|
9
|
-
# warning('http', "The URL (`#{url}`) doesn't use the encrypted HTTPs protocol. " \
|
10
|
-
# 'It is crucial for Pods to be transferred over a secure protocol to protect your users from man-in-the-middle attacks. '\
|
11
|
-
# 'This will be an error in future releases. Please update the URL to use https.')
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# Perform analysis for a given spec (or subspec)
|
15
|
-
#
|
16
|
-
def perform_extensive_analysis(spec)
|
17
|
-
return true
|
18
|
-
end
|
19
|
-
|
20
|
-
#覆盖
|
21
|
-
def check_file_patterns
|
22
|
-
FILE_PATTERNS.each do |attr_name|
|
23
|
-
next if %i(source_files resources).include? attr_name
|
24
|
-
if respond_to?("_validate_#{attr_name}", true)
|
25
|
-
send("_validate_#{attr_name}")
|
26
|
-
else
|
27
|
-
validate_nonempty_patterns(attr_name, :error)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
_validate_header_mappings_dir
|
32
|
-
if consumer.spec.root?
|
33
|
-
_validate_license
|
34
|
-
_validate_module_map
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def validate_source_url(spec); end
|
39
|
-
end
|
40
|
-
end
|