cocoapods-bb-bin 0.1.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.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +19 -0
  3. data/README.md +68 -0
  4. data/lib/cocoapods-bb-bin/command/bin/archive.rb +234 -0
  5. data/lib/cocoapods-bb-bin/command/bin/auto.rb +226 -0
  6. data/lib/cocoapods-bb-bin/command/bin/code.rb +295 -0
  7. data/lib/cocoapods-bb-bin/command/bin/dup.rb +78 -0
  8. data/lib/cocoapods-bb-bin/command/bin/imy.rb +46 -0
  9. data/lib/cocoapods-bb-bin/command/bin/init.rb +69 -0
  10. data/lib/cocoapods-bb-bin/command/bin/initHotKey.rb +70 -0
  11. data/lib/cocoapods-bb-bin/command/bin/install.rb +44 -0
  12. data/lib/cocoapods-bb-bin/command/bin/lib/lint.rb +69 -0
  13. data/lib/cocoapods-bb-bin/command/bin/repo/update.rb +43 -0
  14. data/lib/cocoapods-bb-bin/command/bin/spec/create.rb +73 -0
  15. data/lib/cocoapods-bb-bin/command/bin/spec/push.rb +114 -0
  16. data/lib/cocoapods-bb-bin/command/bin/update.rb +154 -0
  17. data/lib/cocoapods-bb-bin/command/bin.rb +59 -0
  18. data/lib/cocoapods-bb-bin/command.rb +2 -0
  19. data/lib/cocoapods-bb-bin/config/config.rb +136 -0
  20. data/lib/cocoapods-bb-bin/config/config_asker.rb +57 -0
  21. data/lib/cocoapods-bb-bin/config/config_builder.rb +234 -0
  22. data/lib/cocoapods-bb-bin/config/config_hot_key.rb +102 -0
  23. data/lib/cocoapods-bb-bin/config/config_hot_key_asker.rb +57 -0
  24. data/lib/cocoapods-bb-bin/gem_version.rb +10 -0
  25. data/lib/cocoapods-bb-bin/helpers/Info.plist +0 -0
  26. data/lib/cocoapods-bb-bin/helpers/build_helper.rb +217 -0
  27. data/lib/cocoapods-bb-bin/helpers/build_utils.rb +63 -0
  28. data/lib/cocoapods-bb-bin/helpers/framework.rb +85 -0
  29. data/lib/cocoapods-bb-bin/helpers/framework_builder.rb +446 -0
  30. data/lib/cocoapods-bb-bin/helpers/library.rb +54 -0
  31. data/lib/cocoapods-bb-bin/helpers/library_builder.rb +90 -0
  32. data/lib/cocoapods-bb-bin/helpers/sources_helper.rb +36 -0
  33. data/lib/cocoapods-bb-bin/helpers/spec_creator.rb +170 -0
  34. data/lib/cocoapods-bb-bin/helpers/spec_files_helper.rb +77 -0
  35. data/lib/cocoapods-bb-bin/helpers/spec_source_creator.rb +227 -0
  36. data/lib/cocoapods-bb-bin/helpers/upload_helper.rb +96 -0
  37. data/lib/cocoapods-bb-bin/helpers/xcframework_builder.rb +77 -0
  38. data/lib/cocoapods-bb-bin/helpers.rb +5 -0
  39. data/lib/cocoapods-bb-bin/native/acknowledgements.rb +27 -0
  40. data/lib/cocoapods-bb-bin/native/analyzer.rb +55 -0
  41. data/lib/cocoapods-bb-bin/native/file_accessor.rb +28 -0
  42. data/lib/cocoapods-bb-bin/native/installation_options.rb +25 -0
  43. data/lib/cocoapods-bb-bin/native/installer.rb +135 -0
  44. data/lib/cocoapods-bb-bin/native/linter.rb +26 -0
  45. data/lib/cocoapods-bb-bin/native/path_source.rb +33 -0
  46. data/lib/cocoapods-bb-bin/native/pod_source_installer.rb +19 -0
  47. data/lib/cocoapods-bb-bin/native/pod_target_installer.rb +94 -0
  48. data/lib/cocoapods-bb-bin/native/podfile.rb +91 -0
  49. data/lib/cocoapods-bb-bin/native/podfile_env.rb +37 -0
  50. data/lib/cocoapods-bb-bin/native/podfile_generator.rb +199 -0
  51. data/lib/cocoapods-bb-bin/native/podspec_finder.rb +25 -0
  52. data/lib/cocoapods-bb-bin/native/resolver.rb +230 -0
  53. data/lib/cocoapods-bb-bin/native/sandbox_analyzer.rb +34 -0
  54. data/lib/cocoapods-bb-bin/native/source.rb +35 -0
  55. data/lib/cocoapods-bb-bin/native/sources_manager.rb +20 -0
  56. data/lib/cocoapods-bb-bin/native/specification.rb +31 -0
  57. data/lib/cocoapods-bb-bin/native/target_validator.rb +41 -0
  58. data/lib/cocoapods-bb-bin/native/validator.rb +40 -0
  59. data/lib/cocoapods-bb-bin/native.rb +23 -0
  60. data/lib/cocoapods-bb-bin/source_provider_hook.rb +66 -0
  61. data/lib/cocoapods-bb-bin.rb +2 -0
  62. data/lib/cocoapods_plugin.rb +3 -0
  63. data/spec/command/bin_spec.rb +12 -0
  64. data/spec/spec_helper.rb +51 -0
  65. metadata +200 -0
@@ -0,0 +1,66 @@
1
+ require 'cocoapods-bb-bin/native/sources_manager'
2
+ require 'cocoapods-bb-bin/command/bin/repo/update'
3
+ require 'cocoapods/user_interface'
4
+
5
+ Pod::HooksManager.register('cocoapods-bb-bin', :pre_install) do |_context, _|
6
+ require 'cocoapods-bb-bin/native'
7
+
8
+ #pod bin update || install 不走这里
9
+ if $ARGV[1] = 'update' || $ARGV[1] != 'install'
10
+
11
+ else
12
+ # pod bin repo update 更新二进制私有源
13
+ Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new([])).run
14
+
15
+ # 有插件/本地库 且是dev环境下,默认进入源码白名单 过滤 archive命令
16
+ if _context.podfile.plugins.keys.include?('cocoapods-bb-bin') && _context.podfile.configuration_env == 'dev'
17
+ dependencies = _context.podfile.dependencies
18
+ dependencies.each do |d|
19
+ next unless d.respond_to?(:external_source) &&
20
+ d.external_source.is_a?(Hash) &&
21
+ !d.external_source[:path].nil? &&
22
+ $ARGV[1] != 'archive'
23
+ _context.podfile.set_use_source_pods d.name
24
+ end
25
+ end
26
+
27
+ end
28
+
29
+ # 同步 BinPodfile 文件
30
+ project_root = Pod::Config.instance.project_root
31
+ path = File.join(project_root.to_s, 'BinPodfile')
32
+
33
+ next unless File.exist?(path)
34
+
35
+ contents = File.open(path, 'r:utf-8', &:read)
36
+ podfile = Pod::Config.instance.podfile
37
+ podfile.instance_eval do
38
+ begin
39
+ eval(contents, nil, path)
40
+ rescue Exception => e
41
+ message = "Invalid `#{path}` file: #{e.message}"
42
+ raise Pod::DSLError.new(message, path, e, contents)
43
+ end
44
+ end
45
+ end
46
+
47
+ Pod::HooksManager.register('cocoapods-bb-bin', :source_provider) do |context, _|
48
+ #pod bin update || install 不走这里
49
+ if $ARGV[1] == 'update' || $ARGV[1] != 'install'
50
+
51
+ else
52
+ sources_manager = Pod::Config.instance.sources_manager
53
+ podfile = Pod::Config.instance.podfile
54
+
55
+ if podfile
56
+ # 添加源码私有源 && 二进制私有源
57
+ added_sources = [sources_manager.code_source]
58
+ if podfile.use_binaries? || podfile.use_binaries_selector
59
+ added_sources << sources_manager.binary_source
60
+ added_sources.reverse!
61
+ end
62
+ added_sources.each { |source| context.add_source(source) }
63
+ end
64
+ end
65
+
66
+ end
@@ -0,0 +1,2 @@
1
+ require 'cocoapods-bb-bin/gem_version'
2
+ require 'cocoapods-bb-bin/native/sources_manager'
@@ -0,0 +1,3 @@
1
+ require 'cocoapods-bb-bin/gem_version.rb'
2
+ require 'cocoapods-bb-bin/command'
3
+ require 'cocoapods-bb-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,51 @@
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
+ require 'cocoapods-bb-xcframework'
13
+
14
+ Mocha::Configuration.prevent(:stubbing_non_existent_method)
15
+
16
+ require 'cocoapods_plugin'
17
+
18
+ #-----------------------------------------------------------------------------#
19
+
20
+ module Pod
21
+
22
+ # Disable the wrapping so the output is deterministic in the tests.
23
+ #
24
+ UI.disable_wrap = true
25
+
26
+ # Redirects the messages to an internal store.
27
+ #
28
+ module UI
29
+ @output = ''
30
+ @warnings = ''
31
+
32
+ class << self
33
+ attr_accessor :output
34
+ attr_accessor :warnings
35
+
36
+ def puts(message = '')
37
+ @output << "#{message}\n"
38
+ end
39
+
40
+ def warn(message = '', actions = [])
41
+ @warnings << "#{message}\n"
42
+ end
43
+
44
+ def print(message)
45
+ @output << message
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ #-----------------------------------------------------------------------------#
metadata ADDED
@@ -0,0 +1,200 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-bb-bin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - humin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-15 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.10.0
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '2.0'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.10.0
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: cocoapods-generate
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 2.0.1
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 2.0.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: cocoapods-bb-xcframework
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: bundler
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rake
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ description: cocoapods-bb-bin is a plugin which helps develpers switching pods between
104
+ source code and binary.
105
+ email:
106
+ - humin1102@126.com
107
+ executables: []
108
+ extensions: []
109
+ extra_rdoc_files: []
110
+ files:
111
+ - LICENSE.txt
112
+ - README.md
113
+ - lib/cocoapods-bb-bin.rb
114
+ - lib/cocoapods-bb-bin/command.rb
115
+ - lib/cocoapods-bb-bin/command/bin.rb
116
+ - lib/cocoapods-bb-bin/command/bin/archive.rb
117
+ - lib/cocoapods-bb-bin/command/bin/auto.rb
118
+ - lib/cocoapods-bb-bin/command/bin/code.rb
119
+ - lib/cocoapods-bb-bin/command/bin/dup.rb
120
+ - lib/cocoapods-bb-bin/command/bin/imy.rb
121
+ - lib/cocoapods-bb-bin/command/bin/init.rb
122
+ - lib/cocoapods-bb-bin/command/bin/initHotKey.rb
123
+ - lib/cocoapods-bb-bin/command/bin/install.rb
124
+ - lib/cocoapods-bb-bin/command/bin/lib/lint.rb
125
+ - lib/cocoapods-bb-bin/command/bin/repo/update.rb
126
+ - lib/cocoapods-bb-bin/command/bin/spec/create.rb
127
+ - lib/cocoapods-bb-bin/command/bin/spec/push.rb
128
+ - lib/cocoapods-bb-bin/command/bin/update.rb
129
+ - lib/cocoapods-bb-bin/config/config.rb
130
+ - lib/cocoapods-bb-bin/config/config_asker.rb
131
+ - lib/cocoapods-bb-bin/config/config_builder.rb
132
+ - lib/cocoapods-bb-bin/config/config_hot_key.rb
133
+ - lib/cocoapods-bb-bin/config/config_hot_key_asker.rb
134
+ - lib/cocoapods-bb-bin/gem_version.rb
135
+ - lib/cocoapods-bb-bin/helpers.rb
136
+ - lib/cocoapods-bb-bin/helpers/Info.plist
137
+ - lib/cocoapods-bb-bin/helpers/build_helper.rb
138
+ - lib/cocoapods-bb-bin/helpers/build_utils.rb
139
+ - lib/cocoapods-bb-bin/helpers/framework.rb
140
+ - lib/cocoapods-bb-bin/helpers/framework_builder.rb
141
+ - lib/cocoapods-bb-bin/helpers/library.rb
142
+ - lib/cocoapods-bb-bin/helpers/library_builder.rb
143
+ - lib/cocoapods-bb-bin/helpers/sources_helper.rb
144
+ - lib/cocoapods-bb-bin/helpers/spec_creator.rb
145
+ - lib/cocoapods-bb-bin/helpers/spec_files_helper.rb
146
+ - lib/cocoapods-bb-bin/helpers/spec_source_creator.rb
147
+ - lib/cocoapods-bb-bin/helpers/upload_helper.rb
148
+ - lib/cocoapods-bb-bin/helpers/xcframework_builder.rb
149
+ - lib/cocoapods-bb-bin/native.rb
150
+ - lib/cocoapods-bb-bin/native/acknowledgements.rb
151
+ - lib/cocoapods-bb-bin/native/analyzer.rb
152
+ - lib/cocoapods-bb-bin/native/file_accessor.rb
153
+ - lib/cocoapods-bb-bin/native/installation_options.rb
154
+ - lib/cocoapods-bb-bin/native/installer.rb
155
+ - lib/cocoapods-bb-bin/native/linter.rb
156
+ - lib/cocoapods-bb-bin/native/path_source.rb
157
+ - lib/cocoapods-bb-bin/native/pod_source_installer.rb
158
+ - lib/cocoapods-bb-bin/native/pod_target_installer.rb
159
+ - lib/cocoapods-bb-bin/native/podfile.rb
160
+ - lib/cocoapods-bb-bin/native/podfile_env.rb
161
+ - lib/cocoapods-bb-bin/native/podfile_generator.rb
162
+ - lib/cocoapods-bb-bin/native/podspec_finder.rb
163
+ - lib/cocoapods-bb-bin/native/resolver.rb
164
+ - lib/cocoapods-bb-bin/native/sandbox_analyzer.rb
165
+ - lib/cocoapods-bb-bin/native/source.rb
166
+ - lib/cocoapods-bb-bin/native/sources_manager.rb
167
+ - lib/cocoapods-bb-bin/native/specification.rb
168
+ - lib/cocoapods-bb-bin/native/target_validator.rb
169
+ - lib/cocoapods-bb-bin/native/validator.rb
170
+ - lib/cocoapods-bb-bin/source_provider_hook.rb
171
+ - lib/cocoapods_plugin.rb
172
+ - spec/command/bin_spec.rb
173
+ - spec/spec_helper.rb
174
+ homepage: https://github.com/humin1102/cocoapods-bb-bin
175
+ licenses:
176
+ - MIT
177
+ metadata: {}
178
+ post_install_message:
179
+ rdoc_options: []
180
+ require_paths:
181
+ - lib
182
+ required_ruby_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ requirements: []
193
+ rubygems_version: 3.1.4
194
+ signing_key:
195
+ specification_version: 4
196
+ summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between
197
+ source code and binary.
198
+ test_files:
199
+ - spec/command/bin_spec.rb
200
+ - spec/spec_helper.rb