cocoapods-bb-bin 0.1.8.1 → 0.2.0
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 +4 -4
- data/lib/cocoapods-bb-bin/command/bin/lib/lint.rb +2 -2
- data/lib/cocoapods-bb-bin/command/bin/repo/push.rb +10 -10
- data/lib/cocoapods-bb-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bb-bin/helpers/spec_source_creator.rb +7 -0
- data/lib/cocoapods-bb-bin/helpers/upload_helper.rb +4 -2
- data/lib/cocoapods-bb-bin/native/podfile_generator.rb +70 -52
- data/lib/cocoapods-bb-bin/native/push.rb +1 -1
- data/lib/cocoapods-bb-bin/native/resolver.rb +2 -2
- data/lib/cocoapods-bb-bin/native/validator.rb +2 -1
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4926e04b2eaade743939e92c8de3707bdaf3444b06b9515aa45278b63c444df8
|
4
|
+
data.tar.gz: 677d14354d6f11f34a30e956c515f9b9db5040076cdbf2902a71ed9ff3badd65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc1d214967a7056d24836d7162bc5140c771575f1a4f0c59f90b91a47d782ba506069fadb22c35cdf2f4b13a1d6aca9e63595c4c51b068836135a19b30795c0d
|
7
|
+
data.tar.gz: c625ef1d42a31eef96e0f9fc492ddd21066dd59ff35d88a2529f227466ca533cdaf276dbecfe136870abc916e7448fc9dcc381ca958635174b7d8a3785b909ea
|
@@ -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
|
-
|
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('
|
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,17 +96,20 @@ 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
|
-
|
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',
|
110
111
|
'--use-modular-headers',
|
111
112
|
'--swift-version=5.0',
|
112
|
-
'--use_cocoapods_validator', #cocoapods验证
|
113
113
|
*@additional_args
|
114
114
|
]
|
115
115
|
argvs += ['--verbose'] if @verbose
|
@@ -117,7 +117,7 @@ module Pod
|
|
117
117
|
argvs += ['--use-json'] if @use_json
|
118
118
|
argvs += ['--local-only'] if @local_only
|
119
119
|
|
120
|
-
|
120
|
+
UI.puts "pod bin repo push argvs:#{argvs}"
|
121
121
|
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
122
122
|
push.validate!
|
123
123
|
push.run
|
@@ -43,15 +43,22 @@ module CBin
|
|
43
43
|
end
|
44
44
|
|
45
45
|
@filename = file
|
46
|
+
# 拷贝二进制spec到源码spec by hm 22/1/19
|
47
|
+
`cp -fa #{file} #{sourceSpecFilePath}`
|
46
48
|
end
|
47
49
|
|
48
50
|
def clear_spec_file
|
49
51
|
File.delete(filename) if File.exist?(filename)
|
50
52
|
end
|
51
53
|
|
54
|
+
# 二进制spec路径
|
52
55
|
def filename
|
53
56
|
@filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.binary.podspec.json"
|
54
57
|
end
|
58
|
+
# 源码spec路径(指向二进制库)
|
59
|
+
def sourceSpecFilePath
|
60
|
+
@filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
|
61
|
+
end
|
55
62
|
|
56
63
|
private
|
57
64
|
|
@@ -73,14 +73,16 @@ EOF
|
|
73
73
|
# 上传二进制 podspec
|
74
74
|
def push_binary_repo(binary_podsepc_json)
|
75
75
|
argvs = [
|
76
|
-
"#{
|
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']
|
@@ -15,18 +15,16 @@ module Pod
|
|
15
15
|
class PodfileGenerator
|
16
16
|
# @return [Podfile] a podfile suitable for installing the given spec
|
17
17
|
#
|
18
|
-
# @param [Specification]
|
18
|
+
# @param [Array<Specification>] specs
|
19
19
|
#
|
20
|
-
|
21
|
-
|
22
|
-
def podfile_for_spec(spec)
|
20
|
+
def podfile_for_specs(specs)
|
23
21
|
generator = self
|
24
|
-
dir = configuration.
|
25
|
-
project_name = configuration.
|
22
|
+
dir = configuration.gen_dir_for_specs(specs)
|
23
|
+
project_name = configuration.project_name_for_specs(specs)
|
26
24
|
|
27
25
|
Pod::Podfile.new do
|
28
26
|
project "#{project_name}.xcodeproj"
|
29
|
-
workspace "#{
|
27
|
+
workspace "#{project_name}.xcworkspace"
|
30
28
|
|
31
29
|
plugin 'cocoapods-generate'
|
32
30
|
|
@@ -35,8 +33,8 @@ module Pod
|
|
35
33
|
generator.podfile_plugins.each do |name, options|
|
36
34
|
plugin(*[name, options].compact)
|
37
35
|
end
|
38
|
-
|
39
|
-
use_frameworks!(generator.
|
36
|
+
|
37
|
+
use_frameworks!(generator.use_frameworks_value)
|
40
38
|
|
41
39
|
if (supported_swift_versions = generator.supported_swift_versions)
|
42
40
|
supports_swift_versions(supported_swift_versions)
|
@@ -49,44 +47,51 @@ module Pod
|
|
49
47
|
|
50
48
|
self.defined_in_file = dir.join('CocoaPods.podfile.yaml')
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
test_specs_by_spec = Hash[specs.map do |spec|
|
51
|
+
[spec, spec.recursive_subspecs.select(&:test_specification?)]
|
52
|
+
end]
|
53
|
+
app_specs_by_spec = Hash[specs.map do |spec|
|
54
|
+
app_specs = if spec.respond_to?(:app_specification?)
|
55
|
+
spec.recursive_subspecs.select(&:app_specification?)
|
56
|
+
else
|
57
|
+
[]
|
58
|
+
end
|
59
|
+
[spec, app_specs]
|
60
|
+
end]
|
58
61
|
|
59
62
|
# Stick all of the transitive dependencies in an abstract target.
|
60
63
|
# This allows us to force CocoaPods to use the versions / sources / external sources
|
61
64
|
# that we want.
|
62
|
-
|
63
|
-
|
65
|
+
|
64
66
|
# 会导致多个dependencies出现, 注释by slj
|
65
67
|
# abstract_target 'Transitive Dependencies' do
|
66
|
-
# pods_for_transitive_dependencies =
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
68
|
+
# pods_for_transitive_dependencies = specs.flat_map do |spec|
|
69
|
+
# [spec.name]
|
70
|
+
# .concat(test_specs_by_spec.keys.map(&:name))
|
71
|
+
# .concat(test_specs_by_spec.values.flatten.flat_map { |ts| ts.dependencies.flat_map(&:name) })
|
72
|
+
# .concat(app_specs_by_spec.keys.map(&:name))
|
73
|
+
# .concat(app_specs_by_spec.values.flatten.flat_map { |as| as.dependencies.flat_map(&:name) })
|
74
|
+
# end
|
75
|
+
# pods_for_transitive_dependencies.uniq!
|
76
|
+
|
77
|
+
# spec_names = specs.map { |s| s.root.name }.to_set
|
72
78
|
# dependencies = generator
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
79
|
+
# .transitive_dependencies_by_pod
|
80
|
+
# .values_at(*pods_for_transitive_dependencies)
|
81
|
+
# .compact
|
82
|
+
# .flatten(1)
|
83
|
+
# .uniq
|
84
|
+
# .sort_by(&:name)
|
85
|
+
# .reject { |d| spec_names.include?(d.root_name) }
|
86
|
+
|
81
87
|
# dependencies.each do |dependency|
|
82
88
|
# pod_args = generator.pod_args_for_dependency(self, dependency)
|
83
89
|
# pod(*pod_args)
|
84
90
|
# end
|
85
91
|
# end
|
86
92
|
|
87
|
-
# Add platform-specific concrete targets that inherit the
|
88
|
-
|
89
|
-
spec_platform_names = spec.available_platforms.map(&:string_name).flatten.each.reject do |platform_name|
|
93
|
+
# Add platform-specific concrete targets that inherit the `pod` declaration for the local pod.
|
94
|
+
spec_platform_names = specs.flat_map { |s| s.available_platforms.map(&:string_name) }.uniq.each.reject do |platform_name|
|
90
95
|
!generator.configuration.platforms.nil? && !generator.configuration.platforms.include?(platform_name.downcase)
|
91
96
|
end
|
92
97
|
|
@@ -98,8 +103,16 @@ module Pod
|
|
98
103
|
|
99
104
|
# this block has to come _before_ inhibit_all_warnings! / use_modular_headers!,
|
100
105
|
# and the local `pod` declaration
|
101
|
-
#
|
102
|
-
|
106
|
+
# current_target_definition.instance_exec do
|
107
|
+
# transitive_dependencies = children.find { |c| c.name == 'Transitive Dependencies' }
|
108
|
+
|
109
|
+
# %w[use_modular_headers inhibit_warnings].each do |key|
|
110
|
+
# Pod::UI::puts "====key:#{key} value:#{value}"
|
111
|
+
# value = transitive_dependencies.send(:internal_hash).delete(key)
|
112
|
+
# next if value.blank?
|
113
|
+
# set_hash_value(key, value)
|
114
|
+
# end
|
115
|
+
# end
|
103
116
|
|
104
117
|
inhibit_all_warnings! if generator.inhibit_all_warnings?
|
105
118
|
# use_modular_headers! if generator.use_modular_headers?
|
@@ -112,15 +125,18 @@ module Pod
|
|
112
125
|
use_modular_headers!
|
113
126
|
end
|
114
127
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
{ testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
|
120
|
-
pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
|
121
|
-
end
|
128
|
+
specs.each do |spec|
|
129
|
+
# This is the pod declaration for the local pod,
|
130
|
+
# it will be inherited by the concrete target definitions below
|
131
|
+
pod_options = generator.dependency_compilation_kwargs(spec.name)
|
122
132
|
|
123
|
-
|
133
|
+
path = spec.defined_in_file.relative_path_from(dir).to_s
|
134
|
+
pod_options[:path] = path
|
135
|
+
{ testspecs: test_specs_by_spec[spec], appspecs: app_specs_by_spec[spec] }.each do |key, subspecs|
|
136
|
+
pod_options[key] = subspecs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless subspecs.blank?
|
137
|
+
end
|
138
|
+
pod spec.name, **pod_options
|
139
|
+
end
|
124
140
|
|
125
141
|
if Pod::Config.instance.podfile
|
126
142
|
target_definitions['Pods'].instance_exec do
|
@@ -187,14 +203,16 @@ module Pod
|
|
187
203
|
|
188
204
|
# Implement local-sources option to set up dependencies to podspecs in the local filesystem.
|
189
205
|
next if generator.configuration.local_sources.empty?
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
206
|
+
specs.each do |spec|
|
207
|
+
generator.transitive_local_dependencies(spec, generator.configuration.local_sources).sort_by(&:first).each do |dependency, podspec_file|
|
208
|
+
pod_options = generator.dependency_compilation_kwargs(dependency.name)
|
209
|
+
pod_options[:path] = if podspec_file[0] == '/' # absolute path
|
210
|
+
podspec_file
|
211
|
+
else
|
212
|
+
'../../' + podspec_file
|
213
|
+
end
|
214
|
+
pod dependency.name, **pod_options
|
215
|
+
end
|
198
216
|
end
|
199
217
|
end
|
200
218
|
end
|
@@ -27,7 +27,7 @@ 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?('
|
30
|
+
@use_cocoapods_validator = argv.flag?('cocoapods-validator', true)# 配置参数cocoapods进行验证,内部进行hook,二进制hook,源码cocoapods进行验证
|
31
31
|
end
|
32
32
|
|
33
33
|
# Performs a full lint against the podspecs.
|
@@ -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中会异常,因为找不到
|
@@ -5,8 +5,9 @@ module Pod
|
|
5
5
|
# @return [Boolean] 使用cocoapods进行验证,二进制库推送默认不采用cocoapods(1.11.2)验证
|
6
6
|
#
|
7
7
|
# attr_accessor :use_cocoapods_validator
|
8
|
-
def initialize(spec_or_path, source_urls, platforms = [], use_cocoapods_validator =
|
8
|
+
def initialize(spec_or_path, source_urls, platforms = [], use_cocoapods_validator = true)
|
9
9
|
@use_cocoapods_validator = use_cocoapods_validator
|
10
|
+
UI.puts "use_cocoapods_validator = #{use_cocoapods_validator}"
|
10
11
|
@use_frameworks = true
|
11
12
|
@linter = Specification::Linter.new(spec_or_path)
|
12
13
|
@source_urls = if @linter.spec && @linter.spec.dependencies.empty? && @linter.spec.recursive_subspecs.all? { |s| s.dependencies.empty? }
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- humin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: cocoapods-generate
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.2'
|
54
|
+
- - "<"
|
52
55
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
56
|
+
version: '3.0'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '2.2'
|
64
|
+
- - "<"
|
59
65
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
66
|
+
version: '3.0'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: cocoapods-bb-xcframework
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
203
|
- !ruby/object:Gem::Version
|
198
204
|
version: '0'
|
199
205
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
206
|
+
rubygems_version: 3.3.5
|
201
207
|
signing_key:
|
202
208
|
specification_version: 4
|
203
209
|
summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between
|