cocoapods-bindyf 0.1.29.3

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.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +13 -0
  4. data/Gemfile.lock +104 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +567 -0
  7. data/Rakefile +13 -0
  8. data/cocoapods-bin.gemspec +27 -0
  9. data/cocoapods-bindyf-0.1.29.2.gem +0 -0
  10. data/debug_install.sh +8 -0
  11. data/lib/cocoapods-bin.rb +4 -0
  12. data/lib/cocoapods-bin/command.rb +3 -0
  13. data/lib/cocoapods-bin/command/bin.rb +60 -0
  14. data/lib/cocoapods-bin/command/bin/archive.rb +130 -0
  15. data/lib/cocoapods-bin/command/bin/init.rb +71 -0
  16. data/lib/cocoapods-bin/command/bin/lib.rb +14 -0
  17. data/lib/cocoapods-bin/command/bin/lib/lint.rb +69 -0
  18. data/lib/cocoapods-bin/command/bin/list.rb +50 -0
  19. data/lib/cocoapods-bin/command/bin/open.rb +61 -0
  20. data/lib/cocoapods-bin/command/bin/repo.rb +15 -0
  21. data/lib/cocoapods-bin/command/bin/repo/push.rb +124 -0
  22. data/lib/cocoapods-bin/command/bin/repo/update.rb +42 -0
  23. data/lib/cocoapods-bin/command/bin/search.rb +69 -0
  24. data/lib/cocoapods-bin/command/bin/spec.rb +15 -0
  25. data/lib/cocoapods-bin/command/bin/spec/create.rb +75 -0
  26. data/lib/cocoapods-bin/command/bin/spec/lint.rb +119 -0
  27. data/lib/cocoapods-bin/command/bin/umbrella.rb +55 -0
  28. data/lib/cocoapods-bin/config/config.rb +80 -0
  29. data/lib/cocoapods-bin/config/config_asker.rb +58 -0
  30. data/lib/cocoapods-bin/gem_version.rb +11 -0
  31. data/lib/cocoapods-bin/helpers.rb +5 -0
  32. data/lib/cocoapods-bin/helpers/framework.rb +66 -0
  33. data/lib/cocoapods-bin/helpers/framework_builder.rb +190 -0
  34. data/lib/cocoapods-bin/helpers/sources_helper.rb +33 -0
  35. data/lib/cocoapods-bin/helpers/spec_creator.rb +147 -0
  36. data/lib/cocoapods-bin/helpers/spec_files_helper.rb +77 -0
  37. data/lib/cocoapods-bin/native.rb +20 -0
  38. data/lib/cocoapods-bin/native/acknowledgements.rb +27 -0
  39. data/lib/cocoapods-bin/native/analyzer.rb +53 -0
  40. data/lib/cocoapods-bin/native/installation_options.rb +26 -0
  41. data/lib/cocoapods-bin/native/installer.rb +115 -0
  42. data/lib/cocoapods-bin/native/linter.rb +26 -0
  43. data/lib/cocoapods-bin/native/path_source.rb +33 -0
  44. data/lib/cocoapods-bin/native/pod_source_installer.rb +19 -0
  45. data/lib/cocoapods-bin/native/podfile.rb +79 -0
  46. data/lib/cocoapods-bin/native/podfile_env.rb +36 -0
  47. data/lib/cocoapods-bin/native/podspec_finder.rb +25 -0
  48. data/lib/cocoapods-bin/native/resolver.rb +199 -0
  49. data/lib/cocoapods-bin/native/sandbox_analyzer.rb +34 -0
  50. data/lib/cocoapods-bin/native/source.rb +35 -0
  51. data/lib/cocoapods-bin/native/sources_manager.rb +20 -0
  52. data/lib/cocoapods-bin/native/specification.rb +31 -0
  53. data/lib/cocoapods-bin/native/validator.rb +16 -0
  54. data/lib/cocoapods-bin/source_provider_hook.rb +39 -0
  55. data/lib/cocoapods_plugin.rb +5 -0
  56. data/spec/command/bin_spec.rb +12 -0
  57. data/spec/spec_helper.rb +50 -0
  58. metadata +173 -0
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+
5
+ module Pod
6
+ class Source
7
+ # Returns the path of the specification with the given name and version.
8
+ #
9
+ # @param [String] name
10
+ # the name of the Pod.
11
+ #
12
+ # @param [Version,String] version
13
+ # the version for the specification.
14
+ #
15
+ # @return [Pathname] The path of the specification.
16
+ #
17
+ def specification_path(name, version)
18
+ raise ArgumentError, 'No name' unless name
19
+ raise ArgumentError, 'No version' unless version
20
+
21
+ path = pod_path(name) + version.to_s
22
+
23
+ specification_path = Specification::VALID_EXTNAME
24
+ .map { |extname| "#{name}#{extname}" }
25
+ .map { |file| path + file }
26
+ .find(&:exist?)
27
+
28
+ unless specification_path
29
+ raise StandardError, "Unable to find the specification #{name} " \
30
+ "(#{version}) in the #{self.name} source."
31
+ end
32
+ specification_path
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods'
4
+ require 'cocoapods-bin/config/config'
5
+
6
+ module Pod
7
+ class Source
8
+ class Manager
9
+ # 源码 source
10
+ def code_source
11
+ source_with_name_or_url(CBin.config.code_repo_url)
12
+ end
13
+
14
+ # 二进制 source
15
+ def binary_source
16
+ source_with_name_or_url(CBin.config.binary_repo_url)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods-bin/native/sources_manager'
4
+
5
+ module Pod
6
+ class Specification
7
+ VALID_EXTNAME = %w[.binary.podspec.json .binary.podspec .podspec.json .podspec].freeze
8
+ DEFAULT_TEMPLATE_EXTNAME = %w[.binary-template.podspec .binary-template.podspec.json].freeze
9
+
10
+ # TODO
11
+ # 可以在这里根据组件依赖二进制或源码调整 sources 的先后顺序
12
+ # 如果是源码,则调整 code_source 到最前面
13
+ # 如果是二进制,则调整 binary_source 到最前面
14
+ # 这样 CocoaPods 分析时,就会优先获取到对应源的 podspec
15
+ #
16
+ # 先要把 Podfile 里面的配置数据保存到单例中,再在这里判断,就不需要 resolver 了
17
+ # 但是现在这个插件依旧可用,重构需要时间 = = ,没什么动力去重构了呀。。。
18
+ #
19
+ # class Set
20
+ # old_initialize = instance_method(:initialize)
21
+ # define_method(:initialize) do |name, sources|
22
+ # if name == 'TDFAdaptationKit'
23
+ # sources_manager = Pod::Config.instance.sources_manager
24
+ # # sources = [sources_manager.binary_source, *sources].uniq
25
+ # sources = [sources_manager.code_source, *sources].uniq
26
+ # end
27
+ # old_initialize.bind(self).call(name, sources)
28
+ # end
29
+ # end
30
+ end
31
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
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
+ def validate_source_url(spec); end
15
+ end
16
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods-bin/native/sources_manager'
4
+
5
+ Pod::HooksManager.register('cocoapods-bindyf', :pre_install) do |_context, _|
6
+ require 'cocoapods-bin/native'
7
+
8
+ # 同步 BinPodfile 文件
9
+ project_root = Pod::Config.instance.project_root
10
+ path = File.join(project_root.to_s, 'BinPodfile')
11
+
12
+ next unless File.exist?(path)
13
+
14
+ contents = File.open(path, 'r:utf-8', &:read)
15
+
16
+ podfile = Pod::Config.instance.podfile
17
+ podfile.instance_eval do
18
+ begin
19
+ eval(contents, nil, path)
20
+ rescue Exception => e
21
+ message = "Invalid `#{path}` file: #{e.message}"
22
+ raise Pod::DSLError.new(message, path, e, contents)
23
+ end
24
+ end
25
+ end
26
+
27
+ Pod::HooksManager.register('cocoapods-bindyf', :source_provider) do |context, _|
28
+ sources_manager = Pod::Config.instance.sources_manager
29
+ podfile = Pod::Config.instance.podfile
30
+
31
+ if podfile
32
+ # 添加二进制私有源 && 源码私有源
33
+ added_sources = [sources_manager.code_source, sources_manager.binary_source]
34
+ if podfile.use_binaries? || podfile.use_binaries_selector
35
+ added_sources.reverse!
36
+ end
37
+ added_sources.each { |source| context.add_source(source) }
38
+ end
39
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'cocoapods-bin/gem_version.rb'
4
+ require 'cocoapods-bin/command'
5
+ require 'cocoapods-bin/source_provider_hook'
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Bin do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ bin }).should.be.instance_of Command::Bin
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,50 @@
1
+ require 'pathname'
2
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
3
+ $:.unshift((ROOT + 'lib').to_s)
4
+ $:.unshift((ROOT + 'spec').to_s)
5
+
6
+ require 'bundler/setup'
7
+ require 'bacon'
8
+ require 'mocha-on-bacon'
9
+ require 'pretty_bacon'
10
+ require 'pathname'
11
+ require 'cocoapods'
12
+
13
+ Mocha::Configuration.prevent(:stubbing_non_existent_method)
14
+
15
+ require 'cocoapods_plugin'
16
+
17
+ #-----------------------------------------------------------------------------#
18
+
19
+ module Pod
20
+
21
+ # Disable the wrapping so the output is deterministic in the tests.
22
+ #
23
+ UI.disable_wrap = true
24
+
25
+ # Redirects the messages to an internal store.
26
+ #
27
+ module UI
28
+ @output = ''
29
+ @warnings = ''
30
+
31
+ class << self
32
+ attr_accessor :output
33
+ attr_accessor :warnings
34
+
35
+ def puts(message = '')
36
+ @output << "#{message}\n"
37
+ end
38
+
39
+ def warn(message = '', actions = [])
40
+ @warnings << "#{message}\n"
41
+ end
42
+
43
+ def print(message)
44
+ @output << message
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ #-----------------------------------------------------------------------------#
metadata ADDED
@@ -0,0 +1,173 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-bindyf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.29.3
5
+ platform: ruby
6
+ authors:
7
+ - tripleCC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-04-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: parallel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: cocoapods
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.8.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.8.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: cocoapods-generate
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.6.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: cocoapods-bin is a plugin which helps develpers switching pods between
84
+ source code and binary.
85
+ email:
86
+ - triplec.linux@gmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - cocoapods-bin.gemspec
98
+ - cocoapods-bindyf-0.1.29.2.gem
99
+ - debug_install.sh
100
+ - lib/cocoapods-bin.rb
101
+ - lib/cocoapods-bin/command.rb
102
+ - lib/cocoapods-bin/command/bin.rb
103
+ - lib/cocoapods-bin/command/bin/archive.rb
104
+ - lib/cocoapods-bin/command/bin/init.rb
105
+ - lib/cocoapods-bin/command/bin/lib.rb
106
+ - lib/cocoapods-bin/command/bin/lib/lint.rb
107
+ - lib/cocoapods-bin/command/bin/list.rb
108
+ - lib/cocoapods-bin/command/bin/open.rb
109
+ - lib/cocoapods-bin/command/bin/repo.rb
110
+ - lib/cocoapods-bin/command/bin/repo/push.rb
111
+ - lib/cocoapods-bin/command/bin/repo/update.rb
112
+ - lib/cocoapods-bin/command/bin/search.rb
113
+ - lib/cocoapods-bin/command/bin/spec.rb
114
+ - lib/cocoapods-bin/command/bin/spec/create.rb
115
+ - lib/cocoapods-bin/command/bin/spec/lint.rb
116
+ - lib/cocoapods-bin/command/bin/umbrella.rb
117
+ - lib/cocoapods-bin/config/config.rb
118
+ - lib/cocoapods-bin/config/config_asker.rb
119
+ - lib/cocoapods-bin/gem_version.rb
120
+ - lib/cocoapods-bin/helpers.rb
121
+ - lib/cocoapods-bin/helpers/framework.rb
122
+ - lib/cocoapods-bin/helpers/framework_builder.rb
123
+ - lib/cocoapods-bin/helpers/sources_helper.rb
124
+ - lib/cocoapods-bin/helpers/spec_creator.rb
125
+ - lib/cocoapods-bin/helpers/spec_files_helper.rb
126
+ - lib/cocoapods-bin/native.rb
127
+ - lib/cocoapods-bin/native/acknowledgements.rb
128
+ - lib/cocoapods-bin/native/analyzer.rb
129
+ - lib/cocoapods-bin/native/installation_options.rb
130
+ - lib/cocoapods-bin/native/installer.rb
131
+ - lib/cocoapods-bin/native/linter.rb
132
+ - lib/cocoapods-bin/native/path_source.rb
133
+ - lib/cocoapods-bin/native/pod_source_installer.rb
134
+ - lib/cocoapods-bin/native/podfile.rb
135
+ - lib/cocoapods-bin/native/podfile_env.rb
136
+ - lib/cocoapods-bin/native/podspec_finder.rb
137
+ - lib/cocoapods-bin/native/resolver.rb
138
+ - lib/cocoapods-bin/native/sandbox_analyzer.rb
139
+ - lib/cocoapods-bin/native/source.rb
140
+ - lib/cocoapods-bin/native/sources_manager.rb
141
+ - lib/cocoapods-bin/native/specification.rb
142
+ - lib/cocoapods-bin/native/validator.rb
143
+ - lib/cocoapods-bin/source_provider_hook.rb
144
+ - lib/cocoapods_plugin.rb
145
+ - spec/command/bin_spec.rb
146
+ - spec/spec_helper.rb
147
+ homepage: https://github.com/doge1024/cocoapods-bin-framework
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubygems_version: 3.0.3
167
+ signing_key:
168
+ specification_version: 4
169
+ summary: cocoapods-bin is a plugin which helps develpers switching pods between source
170
+ code and binary.
171
+ test_files:
172
+ - spec/command/bin_spec.rb
173
+ - spec/spec_helper.rb