cocoapods-fy-bin 0.0.1

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 (62) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +1 -0
  4. data/lib/cocoapods-fy-bin/command/bin/archive.rb +202 -0
  5. data/lib/cocoapods-fy-bin/command/bin/auto.rb +204 -0
  6. data/lib/cocoapods-fy-bin/command/bin/code.rb +232 -0
  7. data/lib/cocoapods-fy-bin/command/bin/imy.rb +46 -0
  8. data/lib/cocoapods-fy-bin/command/bin/init.rb +69 -0
  9. data/lib/cocoapods-fy-bin/command/bin/initHotKey.rb +70 -0
  10. data/lib/cocoapods-fy-bin/command/bin/install.rb +44 -0
  11. data/lib/cocoapods-fy-bin/command/bin/lib/lint.rb +69 -0
  12. data/lib/cocoapods-fy-bin/command/bin/repo/update.rb +43 -0
  13. data/lib/cocoapods-fy-bin/command/bin/spec/create.rb +73 -0
  14. data/lib/cocoapods-fy-bin/command/bin/spec/push.rb +114 -0
  15. data/lib/cocoapods-fy-bin/command/bin/update.rb +154 -0
  16. data/lib/cocoapods-fy-bin/command/bin.rb +59 -0
  17. data/lib/cocoapods-fy-bin/command.rb +2 -0
  18. data/lib/cocoapods-fy-bin/config/config.rb +137 -0
  19. data/lib/cocoapods-fy-bin/config/config_asker.rb +57 -0
  20. data/lib/cocoapods-fy-bin/config/config_builder.rb +228 -0
  21. data/lib/cocoapods-fy-bin/config/config_hot_key.rb +103 -0
  22. data/lib/cocoapods-fy-bin/config/config_hot_key_asker.rb +57 -0
  23. data/lib/cocoapods-fy-bin/gem_version.rb +10 -0
  24. data/lib/cocoapods-fy-bin/helpers/build_helper.rb +164 -0
  25. data/lib/cocoapods-fy-bin/helpers/build_utils.rb +63 -0
  26. data/lib/cocoapods-fy-bin/helpers/framework.rb +94 -0
  27. data/lib/cocoapods-fy-bin/helpers/framework_builder.rb +419 -0
  28. data/lib/cocoapods-fy-bin/helpers/library.rb +54 -0
  29. data/lib/cocoapods-fy-bin/helpers/library_builder.rb +91 -0
  30. data/lib/cocoapods-fy-bin/helpers/sources_helper.rb +36 -0
  31. data/lib/cocoapods-fy-bin/helpers/spec_creator.rb +170 -0
  32. data/lib/cocoapods-fy-bin/helpers/spec_files_helper.rb +77 -0
  33. data/lib/cocoapods-fy-bin/helpers/spec_source_creator.rb +229 -0
  34. data/lib/cocoapods-fy-bin/helpers/upload_helper.rb +97 -0
  35. data/lib/cocoapods-fy-bin/helpers.rb +5 -0
  36. data/lib/cocoapods-fy-bin/native/acknowledgements.rb +27 -0
  37. data/lib/cocoapods-fy-bin/native/analyzer.rb +55 -0
  38. data/lib/cocoapods-fy-bin/native/file_accessor.rb +28 -0
  39. data/lib/cocoapods-fy-bin/native/installation_options.rb +25 -0
  40. data/lib/cocoapods-fy-bin/native/installer.rb +204 -0
  41. data/lib/cocoapods-fy-bin/native/linter.rb +26 -0
  42. data/lib/cocoapods-fy-bin/native/path_source.rb +33 -0
  43. data/lib/cocoapods-fy-bin/native/pod_source_installer.rb +19 -0
  44. data/lib/cocoapods-fy-bin/native/pod_target_installer.rb +94 -0
  45. data/lib/cocoapods-fy-bin/native/podfile.rb +91 -0
  46. data/lib/cocoapods-fy-bin/native/podfile_env.rb +37 -0
  47. data/lib/cocoapods-fy-bin/native/podfile_generator.rb +199 -0
  48. data/lib/cocoapods-fy-bin/native/podspec_finder.rb +25 -0
  49. data/lib/cocoapods-fy-bin/native/resolver.rb +238 -0
  50. data/lib/cocoapods-fy-bin/native/sandbox_analyzer.rb +34 -0
  51. data/lib/cocoapods-fy-bin/native/source.rb +35 -0
  52. data/lib/cocoapods-fy-bin/native/sources_manager.rb +20 -0
  53. data/lib/cocoapods-fy-bin/native/specification.rb +31 -0
  54. data/lib/cocoapods-fy-bin/native/target_validator.rb +41 -0
  55. data/lib/cocoapods-fy-bin/native/validator.rb +40 -0
  56. data/lib/cocoapods-fy-bin/native.rb +23 -0
  57. data/lib/cocoapods-fy-bin/source_provider_hook.rb +55 -0
  58. data/lib/cocoapods-fy-bin.rb +2 -0
  59. data/lib/cocoapods_plugin.rb +3 -0
  60. data/spec/command/bin_spec.rb +12 -0
  61. data/spec/spec_helper.rb +50 -0
  62. metadata +177 -0
@@ -0,0 +1,23 @@
1
+ require 'cocoapods'
2
+
3
+ if Pod.match_version?('~> 1.4')
4
+ require 'cocoapods-fy-bin/native/podfile'
5
+ require 'cocoapods-fy-bin/native/installation_options'
6
+ require 'cocoapods-fy-bin/native/specification'
7
+ require 'cocoapods-fy-bin/native/path_source'
8
+ require 'cocoapods-fy-bin/native/analyzer'
9
+ require 'cocoapods-fy-bin/native/installer'
10
+ require 'cocoapods-fy-bin/native/podfile_generator'
11
+ require 'cocoapods-fy-bin/native/pod_source_installer'
12
+ require 'cocoapods-fy-bin/native/linter'
13
+ require 'cocoapods-fy-bin/native/resolver'
14
+ require 'cocoapods-fy-bin/native/source'
15
+ require 'cocoapods-fy-bin/native/validator'
16
+ require 'cocoapods-fy-bin/native/acknowledgements'
17
+ require 'cocoapods-fy-bin/native/sandbox_analyzer'
18
+ require 'cocoapods-fy-bin/native/podspec_finder'
19
+ require 'cocoapods-fy-bin/native/file_accessor'
20
+ require 'cocoapods-fy-bin/native/pod_target_installer'
21
+ require 'cocoapods-fy-bin/native/target_validator'
22
+
23
+ end
@@ -0,0 +1,55 @@
1
+ require 'cocoapods-fy-bin/native/sources_manager'
2
+ require 'cocoapods-fy-bin/command/bin/repo/update'
3
+ require 'cocoapods/user_interface'
4
+
5
+ Pod::HooksManager.register('cocoapods-fy-bin', :pre_install) do |_context, _|
6
+ require 'cocoapods-fy-bin/native'
7
+
8
+ # pod bin repo update 更新二进制私有源
9
+ Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new([])).run
10
+
11
+ # 有插件/本地库 且是dev环境下,默认进入源码白名单 过滤 archive命令
12
+ if _context.podfile.plugins.keys.include?('cocoapods-fy-bin') && _context.podfile.configuration_env == 'dev'
13
+ dependencies = _context.podfile.dependencies
14
+ dependencies.each do |d|
15
+ # 组件存在external_source,并且external_source有值 并且external_source path不为空 且不为archive状态时 设置组件加载路径
16
+ next unless d.respond_to?(:external_source) &&
17
+ d.external_source.is_a?(Hash) &&
18
+ !d.external_source[:path].nil? &&
19
+ $ARGV[1] != 'archive'
20
+ _context.podfile.set_use_source_pods d.name
21
+ end
22
+ end
23
+
24
+ # 同步 BinPodfile 文件
25
+ project_root = Pod::Config.instance.project_root
26
+ path = File.join(project_root.to_s, 'BinPodfile')
27
+
28
+ next unless File.exist?(path)
29
+
30
+ contents = File.open(path, 'r:utf-8', &:read)
31
+ podfile = Pod::Config.instance.podfile
32
+ podfile.instance_eval do
33
+ begin
34
+ eval(contents, nil, path)
35
+ rescue Exception => e
36
+ message = "Invalid `#{path}` file: #{e.message}"
37
+ raise Pod::DSLError.new(message, path, e, contents)
38
+ end
39
+ end
40
+ end
41
+
42
+ Pod::HooksManager.register('cocoapods-fy-bin', :source_provider) do |context, _|
43
+ sources_manager = Pod::Config.instance.sources_manager
44
+ podfile = Pod::Config.instance.podfile
45
+
46
+ if podfile
47
+ # 添加源码私有源 && 二进制私有源
48
+ added_sources = [sources_manager.code_source]
49
+ if podfile.use_binaries? || podfile.use_binaries_selector
50
+ added_sources << sources_manager.binary_source
51
+ added_sources.reverse!
52
+ end
53
+ added_sources.each { |source| context.add_source(source) }
54
+ end
55
+ end
@@ -0,0 +1,2 @@
1
+ require 'cocoapods-fy-bin/gem_version'
2
+ require 'cocoapods-fy-bin/native/sources_manager'
@@ -0,0 +1,3 @@
1
+ require 'cocoapods-fy-bin/gem_version.rb'
2
+ require 'cocoapods-fy-bin/command'
3
+ require 'cocoapods-fy-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,177 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-fy-bin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - dr
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-07-27 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: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
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: 2.0.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.0.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
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-fy-bin is a plugin which helps develpers switching pods between
84
+ source code and binary.
85
+ email:
86
+ - drwd123@163.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - LICENSE.txt
92
+ - README.md
93
+ - lib/cocoapods-fy-bin.rb
94
+ - lib/cocoapods-fy-bin/command.rb
95
+ - lib/cocoapods-fy-bin/command/bin.rb
96
+ - lib/cocoapods-fy-bin/command/bin/archive.rb
97
+ - lib/cocoapods-fy-bin/command/bin/auto.rb
98
+ - lib/cocoapods-fy-bin/command/bin/code.rb
99
+ - lib/cocoapods-fy-bin/command/bin/imy.rb
100
+ - lib/cocoapods-fy-bin/command/bin/init.rb
101
+ - lib/cocoapods-fy-bin/command/bin/initHotKey.rb
102
+ - lib/cocoapods-fy-bin/command/bin/install.rb
103
+ - lib/cocoapods-fy-bin/command/bin/lib/lint.rb
104
+ - lib/cocoapods-fy-bin/command/bin/repo/update.rb
105
+ - lib/cocoapods-fy-bin/command/bin/spec/create.rb
106
+ - lib/cocoapods-fy-bin/command/bin/spec/push.rb
107
+ - lib/cocoapods-fy-bin/command/bin/update.rb
108
+ - lib/cocoapods-fy-bin/config/config.rb
109
+ - lib/cocoapods-fy-bin/config/config_asker.rb
110
+ - lib/cocoapods-fy-bin/config/config_builder.rb
111
+ - lib/cocoapods-fy-bin/config/config_hot_key.rb
112
+ - lib/cocoapods-fy-bin/config/config_hot_key_asker.rb
113
+ - lib/cocoapods-fy-bin/gem_version.rb
114
+ - lib/cocoapods-fy-bin/helpers.rb
115
+ - lib/cocoapods-fy-bin/helpers/build_helper.rb
116
+ - lib/cocoapods-fy-bin/helpers/build_utils.rb
117
+ - lib/cocoapods-fy-bin/helpers/framework.rb
118
+ - lib/cocoapods-fy-bin/helpers/framework_builder.rb
119
+ - lib/cocoapods-fy-bin/helpers/library.rb
120
+ - lib/cocoapods-fy-bin/helpers/library_builder.rb
121
+ - lib/cocoapods-fy-bin/helpers/sources_helper.rb
122
+ - lib/cocoapods-fy-bin/helpers/spec_creator.rb
123
+ - lib/cocoapods-fy-bin/helpers/spec_files_helper.rb
124
+ - lib/cocoapods-fy-bin/helpers/spec_source_creator.rb
125
+ - lib/cocoapods-fy-bin/helpers/upload_helper.rb
126
+ - lib/cocoapods-fy-bin/native.rb
127
+ - lib/cocoapods-fy-bin/native/acknowledgements.rb
128
+ - lib/cocoapods-fy-bin/native/analyzer.rb
129
+ - lib/cocoapods-fy-bin/native/file_accessor.rb
130
+ - lib/cocoapods-fy-bin/native/installation_options.rb
131
+ - lib/cocoapods-fy-bin/native/installer.rb
132
+ - lib/cocoapods-fy-bin/native/linter.rb
133
+ - lib/cocoapods-fy-bin/native/path_source.rb
134
+ - lib/cocoapods-fy-bin/native/pod_source_installer.rb
135
+ - lib/cocoapods-fy-bin/native/pod_target_installer.rb
136
+ - lib/cocoapods-fy-bin/native/podfile.rb
137
+ - lib/cocoapods-fy-bin/native/podfile_env.rb
138
+ - lib/cocoapods-fy-bin/native/podfile_generator.rb
139
+ - lib/cocoapods-fy-bin/native/podspec_finder.rb
140
+ - lib/cocoapods-fy-bin/native/resolver.rb
141
+ - lib/cocoapods-fy-bin/native/sandbox_analyzer.rb
142
+ - lib/cocoapods-fy-bin/native/source.rb
143
+ - lib/cocoapods-fy-bin/native/sources_manager.rb
144
+ - lib/cocoapods-fy-bin/native/specification.rb
145
+ - lib/cocoapods-fy-bin/native/target_validator.rb
146
+ - lib/cocoapods-fy-bin/native/validator.rb
147
+ - lib/cocoapods-fy-bin/source_provider_hook.rb
148
+ - lib/cocoapods_plugin.rb
149
+ - spec/command/bin_spec.rb
150
+ - spec/spec_helper.rb
151
+ homepage: https://github.com/dr19900920/cocoapods-fy-bin
152
+ licenses:
153
+ - MIT
154
+ metadata: {}
155
+ post_install_message:
156
+ rdoc_options: []
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubygems_version: 3.0.9
171
+ signing_key:
172
+ specification_version: 4
173
+ summary: cocoapods-fy-bin is a plugin which helps develpers switching pods between
174
+ source code and binary.
175
+ test_files:
176
+ - spec/command/bin_spec.rb
177
+ - spec/spec_helper.rb