cocoapods-bin 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cocoapods-bin/command/bin/lib/lint.rb +5 -44
- data/lib/cocoapods-bin/command/bin/repo/push.rb +2 -2
- data/lib/cocoapods-bin/command/bin/spec/lint.rb +49 -4
- data/lib/cocoapods-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bin/helpers/spec_creator.rb +2 -0
- data/lib/cocoapods-bin/native/resolver.rb +4 -7
- data/lib/cocoapods-bin/native/sandbox_analyzer.rb +18 -0
- data/lib/cocoapods-bin/native.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da7e02c4a75fce8b60ddc9f9575863846d1a9d03
|
4
|
+
data.tar.gz: e40f144b646e287b756472779abd5f299dadc8b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcc17d1b13421da3dfa305b76adc80ebe1dc1b187d4dd61b96fa7d9debaf36b9269a6b6a9937e1ba8882fbdac9146b667dd123047120c50bdd9bfdb7b95bb7d
|
7
|
+
data.tar.gz: '0849fc6226f2a9a8069619e79184154eaba82c61c603ec275c41692cf8436c5ad0a0680e3fac8df535e5bc92f45f944203cbf542499e19358924dd527394f7ff'
|
data/Gemfile.lock
CHANGED
@@ -15,24 +15,19 @@ module Pod
|
|
15
15
|
CLAide::Argument.new('NAME.podspec', false),
|
16
16
|
]
|
17
17
|
|
18
|
+
# lib lint 不会下载 source,所以不能进行二进制 lint
|
19
|
+
# 要 lint 二进制版本,需要进行 spec lint,此 lint 会去下载 source
|
18
20
|
def self.options
|
19
21
|
[
|
20
|
-
['--binary', 'lint 组件的二进制版本'],
|
21
|
-
['--template-podspec=A.binary-template.podspec', '生成拥有 subspec 的二进制 spec 需要的模版 podspec, 插件会更改 version 和 source'],
|
22
22
|
['--code-dependencies', '使用源码依赖进行 lint'],
|
23
|
-
['--loose-options', '添加宽松的 options,
|
24
|
-
['--reserve-created-spec', '保留生成的二进制 spec 文件'],
|
23
|
+
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
25
24
|
].concat(Pod::Command::Lib::Lint.options).concat(super).uniq
|
26
25
|
end
|
27
26
|
|
28
27
|
def initialize(argv)
|
29
|
-
@podspec = argv.shift_argument
|
30
|
-
@binary = argv.flag?('binary')
|
31
28
|
@loose_options = argv.flag?('loose-options')
|
32
29
|
@code_dependencies = argv.flag?('code-dependencies')
|
33
30
|
@sources = argv.option('sources') || []
|
34
|
-
@reserve_created_spec = argv.flag?('reserve-created-spec')
|
35
|
-
@template_podspec = argv.option('template-podspec')
|
36
31
|
super
|
37
32
|
|
38
33
|
@additional_args = argv.remainder!
|
@@ -44,53 +39,19 @@ module Pod
|
|
44
39
|
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
45
40
|
*@additional_args
|
46
41
|
]
|
47
|
-
|
48
|
-
argvs << spec_file if spec_file
|
49
42
|
|
50
43
|
if @loose_options
|
51
44
|
argvs << '--allow-warnings'
|
52
|
-
argvs << '--use-libraries' if code_spec
|
45
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
53
46
|
end
|
54
47
|
|
55
48
|
lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
|
56
49
|
lint.validate!
|
57
50
|
lint.run
|
58
51
|
end
|
59
|
-
ensure
|
60
|
-
clear_binary_spec_file_if_needed unless @reserve_created_spec
|
61
52
|
end
|
62
53
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
def template_spec_file
|
67
|
-
@template_spec_file ||= begin
|
68
|
-
if @template_podspec
|
69
|
-
find_spec_file(@template_podspec)
|
70
|
-
else
|
71
|
-
binary_template_spec_file
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def spec_file
|
77
|
-
@spec_file ||= begin
|
78
|
-
if @podspec
|
79
|
-
find_spec_file(@podspec)
|
80
|
-
else
|
81
|
-
raise Informative, "当前目录下没有找到可用源码 podspec." if code_spec_files.empty?
|
82
|
-
|
83
|
-
spec_file = if @binary
|
84
|
-
code_spec = Pod::Specification.from_file(code_spec_files.first)
|
85
|
-
template_spec = Pod::Specification.from_file(template_spec_file) if template_spec_file
|
86
|
-
create_binary_spec_file(code_spec, template_spec)
|
87
|
-
else
|
88
|
-
code_spec_files.first
|
89
|
-
end
|
90
|
-
spec_file
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
54
|
+
|
94
55
|
end
|
95
56
|
end
|
96
57
|
end
|
@@ -20,7 +20,7 @@ module Pod
|
|
20
20
|
['--binary', '发布组件的二进制版本'],
|
21
21
|
['--template-podspec=A.binary-template.podspec', '生成拥有 subspec 的二进制 spec 需要的模版 podspec, 插件会更改 version 和 source'],
|
22
22
|
['--code-dependencies', '使用源码依赖进行 lint'],
|
23
|
-
['--loose-options', '添加宽松的 options,
|
23
|
+
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
24
24
|
['--reserve-created-spec', '保留生成的二进制 spec 文件'],
|
25
25
|
].concat(Pod::Command::Repo::Push.options).concat(super).uniq
|
26
26
|
end
|
@@ -50,7 +50,7 @@ module Pod
|
|
50
50
|
|
51
51
|
if @loose_options
|
52
52
|
argvs += ['--allow-warnings', '--use-json']
|
53
|
-
argvs << '--use-libraries' if code_spec
|
53
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
54
54
|
end
|
55
55
|
|
56
56
|
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
@@ -12,20 +12,27 @@ module Pod
|
|
12
12
|
DESC
|
13
13
|
|
14
14
|
self.arguments = [
|
15
|
-
CLAide::Argument.new(%w(NAME.podspec DIRECTORY http://PATH/NAME.podspec), false, true)
|
15
|
+
CLAide::Argument.new(%w(NAME.podspec DIRECTORY http://PATH/NAME.podspec), false, true),
|
16
16
|
]
|
17
17
|
|
18
18
|
def self.options
|
19
19
|
[
|
20
|
+
['--binary', 'lint 组件的二进制版本'],
|
21
|
+
['--template-podspec=A.binary-template.podspec', '生成拥有 subspec 的二进制 spec 需要的模版 podspec, 插件会更改 version 和 source'],
|
22
|
+
['--reserve-created-spec', '保留生成的二进制 spec 文件'],
|
20
23
|
['--code-dependencies', '使用源码依赖进行 lint'],
|
21
|
-
['--loose-options', '添加宽松的 options'],
|
24
|
+
['--loose-options', '添加宽松的 options, 包括 --use-libraries (可能会造成 entry point (start) undefined)'],
|
22
25
|
].concat(Pod::Command::Lib::Spec.options).concat(super).uniq
|
23
26
|
end
|
24
27
|
|
25
28
|
def initialize(argv)
|
29
|
+
@podspec = argv.shift_argument
|
26
30
|
@loose_options = argv.flag?('loose-options')
|
27
31
|
@code_dependencies = argv.flag?('code-dependencies')
|
28
32
|
@sources = argv.option('sources') || []
|
33
|
+
@binary = argv.flag?('binary')
|
34
|
+
@reserve_created_spec = argv.flag?('reserve-created-spec')
|
35
|
+
@template_podspec = argv.option('template-podspec')
|
29
36
|
super
|
30
37
|
|
31
38
|
@additional_args = argv.remainder!
|
@@ -37,13 +44,51 @@ module Pod
|
|
37
44
|
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
38
45
|
*@additional_args
|
39
46
|
]
|
40
|
-
|
41
|
-
argvs
|
47
|
+
|
48
|
+
argvs << spec_file if spec_file
|
49
|
+
|
50
|
+
if @loose_options
|
51
|
+
argvs += ['--allow-warnings']
|
52
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
53
|
+
end
|
42
54
|
|
43
55
|
lint = Pod::Command::Spec::Lint.new(CLAide::ARGV.new(argvs))
|
44
56
|
lint.validate!
|
45
57
|
lint.run
|
46
58
|
end
|
59
|
+
ensure
|
60
|
+
clear_binary_spec_file_if_needed unless @reserve_created_spec
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def template_spec_file
|
66
|
+
@template_spec_file ||= begin
|
67
|
+
if @template_podspec
|
68
|
+
find_spec_file(@template_podspec)
|
69
|
+
else
|
70
|
+
binary_template_spec_file
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def spec_file
|
76
|
+
@spec_file ||= begin
|
77
|
+
if @podspec
|
78
|
+
find_spec_file(@podspec) || @podspec
|
79
|
+
else
|
80
|
+
raise Informative, "当前目录下没有找到可用源码 podspec." if code_spec_files.empty?
|
81
|
+
|
82
|
+
spec_file = if @binary
|
83
|
+
code_spec = Pod::Specification.from_file(code_spec_files.first)
|
84
|
+
template_spec = Pod::Specification.from_file(template_spec_file) if template_spec_file
|
85
|
+
create_binary_spec_file(code_spec, template_spec)
|
86
|
+
else
|
87
|
+
code_spec_files.first
|
88
|
+
end
|
89
|
+
spec_file
|
90
|
+
end
|
91
|
+
end
|
47
92
|
end
|
48
93
|
end
|
49
94
|
end
|
@@ -13,15 +13,12 @@ module Pod
|
|
13
13
|
if Pod.match_version?('~> 1.4')
|
14
14
|
old_resolver_specs_by_target = instance_method(:resolver_specs_by_target)
|
15
15
|
define_method(:resolver_specs_by_target) do
|
16
|
-
|
17
|
-
|
18
|
-
# 过滤出用户工程
|
19
|
-
user_specs_by_target = resolver_specs_by_target.reject { |st| st.name.end_with?('_Tests') || st.name == 'Pods' }
|
16
|
+
specs_by_target = old_resolver_specs_by_target.bind(self).call()
|
20
17
|
|
21
18
|
sources_manager = Config.instance.sources_manager
|
22
19
|
use_source_pods = podfile.use_source_pods
|
23
20
|
|
24
|
-
|
21
|
+
specs_by_target.each do |target, rspecs|
|
25
22
|
# use_binaries 并且 use_source_pods 不包含
|
26
23
|
use_binary_rspecs = if podfile.use_binaries? || podfile.use_binaries_selector
|
27
24
|
rspecs.select do |rspec|
|
@@ -33,7 +30,7 @@ module Pod
|
|
33
30
|
end
|
34
31
|
|
35
32
|
# Parallel.map(rspecs, in_threads: 8) do |rspec|
|
36
|
-
|
33
|
+
specs_by_target[target] = rspecs.map do |rspec|
|
37
34
|
# 含有 subspecs 的组件暂不处理
|
38
35
|
# next rspec if rspec.spec.subspec? || rspec.spec.subspecs.any?
|
39
36
|
|
@@ -72,7 +69,7 @@ module Pod
|
|
72
69
|
end.compact
|
73
70
|
end
|
74
71
|
|
75
|
-
|
72
|
+
specs_by_target
|
76
73
|
end
|
77
74
|
end
|
78
75
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Pod
|
2
|
+
class Installer
|
3
|
+
class Analyzer
|
4
|
+
class SandboxAnalyzer
|
5
|
+
# def pod_changed?(pod)
|
6
|
+
# spec = root_spec(pod)
|
7
|
+
|
8
|
+
# return true if spec.version != sandbox_version(pod)
|
9
|
+
# return true if spec.checksum != sandbox_checksum(pod)
|
10
|
+
# return true if resolved_spec_names(pod) != sandbox_spec_names(pod)
|
11
|
+
# return true if sandbox.predownloaded?(pod)
|
12
|
+
# return true if folder_empty?(pod)
|
13
|
+
# false
|
14
|
+
# end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/cocoapods-bin/native.rb
CHANGED
@@ -13,6 +13,7 @@ if Pod.match_version?('~> 1.4')
|
|
13
13
|
require 'cocoapods-bin/native/source'
|
14
14
|
require 'cocoapods-bin/native/validator'
|
15
15
|
require 'cocoapods-bin/native/acknowledgements'
|
16
|
+
require 'cocoapods-bin/native/sandbox_analyzer'
|
16
17
|
end
|
17
18
|
|
18
19
|
require 'cocoapods-bin/native/source_provider_hook'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tripleCC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/cocoapods-bin/native/pod_source_installer.rb
|
113
113
|
- lib/cocoapods-bin/native/podfile.rb
|
114
114
|
- lib/cocoapods-bin/native/resolver.rb
|
115
|
+
- lib/cocoapods-bin/native/sandbox_analyzer.rb
|
115
116
|
- lib/cocoapods-bin/native/source.rb
|
116
117
|
- lib/cocoapods-bin/native/source_provider_hook.rb
|
117
118
|
- lib/cocoapods-bin/native/sources_manager.rb
|