cocoapods-bin 0.1.6 → 0.1.7
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/Gemfile.lock +1 -1
- data/lib/cocoapods-bin/command/bin/lib/lint.rb +16 -14
- data/lib/cocoapods-bin/command/bin/repo/push.rb +17 -15
- data/lib/cocoapods-bin/command/bin/spec/lint.rb +16 -14
- data/lib/cocoapods-bin/gem_version.rb +1 -1
- data/lib/cocoapods-bin/helpers/sources_helper.rb +1 -1
- data/lib/cocoapods-bin/helpers/spec_files_helper.rb +2 -1
- data/lib/cocoapods-bin/native.rb +0 -2
- data/lib/cocoapods-bin/native/podfile.rb +17 -22
- data/lib/cocoapods-bin/native/podfile_env.rb +34 -0
- data/lib/cocoapods-bin/source_provider_hook.rb +17 -0
- data/lib/cocoapods_plugin.rb +1 -1
- metadata +4 -3
- data/lib/cocoapods-bin/native/source_provider_hook.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7659c97e073a001e2ebdf133d08f85e2ee186c15
|
4
|
+
data.tar.gz: 054c458cdd2b9675d25f529803d6fc0f48d445d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60fa57fa0d67d9a05cc47d47a08ff78358beebe3c9052382defa468a1b3dd93e63d32f1eae53d4936698d372870f12e2def7c61b2ac93170a7c4cbd2f2b32347
|
7
|
+
data.tar.gz: fc2fd9f4856e777edf153d166fdf109a912da641a499dc053f38b7a8442718384b9fd0ea6e52e6b5f2cf78c1b7061afabe5c56a15e93b1ab08ac54be7fed6f4d
|
data/Gemfile.lock
CHANGED
@@ -37,22 +37,24 @@ module Pod
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def run
|
40
|
-
Podfile.
|
41
|
-
Podfile.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
Podfile.execute_with_bin_plugin do
|
41
|
+
Podfile.execute_with_allow_prerelease(@allow_prerelease) do
|
42
|
+
Podfile.execute_with_use_binaries(!@code_dependencies) do
|
43
|
+
argvs = [
|
44
|
+
@podspec || code_spec_files.first,
|
45
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
46
|
+
*@additional_args
|
47
|
+
]
|
48
|
+
|
49
|
+
if @loose_options
|
50
|
+
argvs << '--allow-warnings'
|
51
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
52
|
+
end
|
47
53
|
|
48
|
-
|
49
|
-
|
50
|
-
|
54
|
+
lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
|
55
|
+
lint.validate!
|
56
|
+
lint.run
|
51
57
|
end
|
52
|
-
|
53
|
-
lint = Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
|
54
|
-
lint.validate!
|
55
|
-
lint.run
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
@@ -41,24 +41,26 @@ module Pod
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def run
|
44
|
-
Podfile.
|
45
|
-
Podfile.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
+
]
|
51
52
|
|
52
|
-
|
53
|
+
argvs << spec_file if spec_file
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
if @loose_options
|
56
|
+
argvs += ['--allow-warnings', '--use-json']
|
57
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
58
|
+
end
|
59
|
+
|
60
|
+
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
61
|
+
push.validate!
|
62
|
+
push.run
|
57
63
|
end
|
58
|
-
|
59
|
-
push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
|
60
|
-
push.validate!
|
61
|
-
push.run
|
62
64
|
end
|
63
65
|
end
|
64
66
|
ensure
|
@@ -41,23 +41,25 @@ module Pod
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def run
|
44
|
-
Podfile.
|
45
|
-
Podfile.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
+
"--sources=#{sources_option(@code_dependencies, @sources)}",
|
49
|
+
*@additional_args
|
50
|
+
]
|
50
51
|
|
51
|
-
|
52
|
+
argvs << spec_file if spec_file
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
if @loose_options
|
55
|
+
argvs += ['--allow-warnings']
|
56
|
+
argvs << '--use-libraries' if code_spec&.all_dependencies&.any?
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
lint = Pod::Command::Spec::Lint.new(CLAide::ARGV.new(argvs))
|
60
|
+
lint.validate!
|
61
|
+
lint.run
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
63
65
|
ensure
|
data/lib/cocoapods-bin/native.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'cocoapods'
|
2
|
+
require 'cocoapods-bin/native/podfile_env'
|
2
3
|
|
3
4
|
module Pod
|
4
5
|
class Podfile
|
5
|
-
USE_BINARIES = 'use_binaries'.freeze
|
6
|
-
USE_SOURCE_PODS = 'use_source_pods'.freeze
|
7
|
-
USE_BINARIES_SELECTOR = 'use_binaries_selector'.freeze
|
8
|
-
ALLOW_PRERELEASE = 'allow_prerelease'.freeze
|
9
6
|
# TREAT_DEVELOPMENTS_AS_NORMAL = 'treat_developments_as_normal'.freeze
|
10
7
|
|
11
8
|
module DSL
|
@@ -30,27 +27,19 @@ module Pod
|
|
30
27
|
end
|
31
28
|
end
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
origin_value = ENV[key]
|
44
|
-
ENV[key] = value_returner.call
|
45
|
-
|
46
|
-
yield if block_given?
|
47
|
-
|
48
|
-
ENV[key] = origin_value
|
30
|
+
alias_method :old_plugins, :plugins
|
31
|
+
def plugins
|
32
|
+
if ENV[USE_PLUGINS]
|
33
|
+
env_plugins = ENV[USE_PLUGINS].split(',').reduce({}) do |result, name|
|
34
|
+
result[name] = {}
|
35
|
+
result
|
36
|
+
end
|
37
|
+
env_plugins.merge!(old_plugins)
|
38
|
+
else
|
39
|
+
old_plugins
|
49
40
|
end
|
50
41
|
end
|
51
42
|
|
52
|
-
extend ENVExecutor
|
53
|
-
|
54
43
|
def use_binaries_selector
|
55
44
|
get_internal_hash_value(USE_BINARIES_SELECTOR, nil)
|
56
45
|
end
|
@@ -68,8 +57,14 @@ module Pod
|
|
68
57
|
end
|
69
58
|
|
70
59
|
private
|
60
|
+
def valid_bin_plugin
|
61
|
+
raise Pod::Informative, 'You should add `plugin \'cocoapods-bin\'` before using its DSL' unless plugins.keys.include?('cocoapods-bin')
|
62
|
+
end
|
63
|
+
|
71
64
|
# set_hash_value 有 key 限制
|
72
65
|
def set_internal_hash_value(key, value)
|
66
|
+
valid_bin_plugin
|
67
|
+
|
73
68
|
internal_hash[key] = value
|
74
69
|
end
|
75
70
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Pod
|
2
|
+
class Podfile
|
3
|
+
USE_BINARIES = 'use_binaries'.freeze
|
4
|
+
USE_SOURCE_PODS = 'use_source_pods'.freeze
|
5
|
+
USE_BINARIES_SELECTOR = 'use_binaries_selector'.freeze
|
6
|
+
ALLOW_PRERELEASE = 'allow_prerelease'.freeze
|
7
|
+
USE_PLUGINS = 'use_plugins'.freeze
|
8
|
+
|
9
|
+
module ENVExecutor
|
10
|
+
def execute_with_bin_plugin(&block)
|
11
|
+
execute_with_key(USE_PLUGINS, -> {'cocoapods-bin'}, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def execute_with_allow_prerelease(allow_prerelease, &block)
|
15
|
+
execute_with_key(ALLOW_PRERELEASE, -> { allow_prerelease ? 'true' : 'false' }, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def execute_with_use_binaries(use_binaries, &block)
|
19
|
+
execute_with_key(USE_BINARIES, -> { use_binaries ? 'true' : 'false' }, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute_with_key(key, value_returner, &block)
|
23
|
+
origin_value = ENV[key]
|
24
|
+
ENV[key] = value_returner.call
|
25
|
+
|
26
|
+
yield if block_given?
|
27
|
+
|
28
|
+
ENV[key] = origin_value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
extend ENVExecutor
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'cocoapods-bin/native/sources_manager'
|
2
|
+
|
3
|
+
Pod::HooksManager.register('cocoapods-bin', :pre_install) do |context, _|
|
4
|
+
require 'cocoapods-bin/native'
|
5
|
+
end
|
6
|
+
|
7
|
+
Pod::HooksManager.register('cocoapods-bin', :source_provider) do |context, _|
|
8
|
+
sources_manager = Pod::Config.instance.sources_manager
|
9
|
+
podfile = Pod::Config.instance.podfile
|
10
|
+
|
11
|
+
if podfile
|
12
|
+
# 添加二进制私有源 && 源码私有源
|
13
|
+
added_sources = [sources_manager.code_source, sources_manager.binary_source]
|
14
|
+
added_sources.reverse! if podfile.use_binaries? || podfile.use_binaries_selector
|
15
|
+
added_sources.each { |source| context.add_source(source) }
|
16
|
+
end
|
17
|
+
end
|
data/lib/cocoapods_plugin.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.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-02-
|
11
|
+
date: 2019-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -112,13 +112,14 @@ files:
|
|
112
112
|
- lib/cocoapods-bin/native/path_source.rb
|
113
113
|
- lib/cocoapods-bin/native/pod_source_installer.rb
|
114
114
|
- lib/cocoapods-bin/native/podfile.rb
|
115
|
+
- lib/cocoapods-bin/native/podfile_env.rb
|
115
116
|
- lib/cocoapods-bin/native/resolver.rb
|
116
117
|
- lib/cocoapods-bin/native/sandbox_analyzer.rb
|
117
118
|
- lib/cocoapods-bin/native/source.rb
|
118
|
-
- lib/cocoapods-bin/native/source_provider_hook.rb
|
119
119
|
- lib/cocoapods-bin/native/sources_manager.rb
|
120
120
|
- lib/cocoapods-bin/native/specification.rb
|
121
121
|
- lib/cocoapods-bin/native/validator.rb
|
122
|
+
- lib/cocoapods-bin/source_provider_hook.rb
|
122
123
|
- lib/cocoapods_plugin.rb
|
123
124
|
- spec/command/bin_spec.rb
|
124
125
|
- spec/spec_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'cocoapods-bin/native/sources_manager'
|
2
|
-
|
3
|
-
Pod::HooksManager.register('cocoapods-bin', :source_provider) do |context, _|
|
4
|
-
sources_manager = Pod::Config.instance.sources_manager
|
5
|
-
podfile = Pod::Config.instance.podfile
|
6
|
-
|
7
|
-
# 添加二进制私有源 && 源码私有源
|
8
|
-
added_sources = [sources_manager.code_source, sources_manager.binary_source]
|
9
|
-
added_sources.reverse! if podfile.use_binaries? || podfile.use_binaries_selector
|
10
|
-
added_sources.each { |source| context.add_source(source) }
|
11
|
-
end
|