cocoapods-tdf-bin 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +103 -0
  4. data/lib/cocoapods-tdf-bin.rb +2 -0
  5. data/lib/cocoapods-tdf-bin/command.rb +2 -0
  6. data/lib/cocoapods-tdf-bin/command/bin.rb +57 -0
  7. data/lib/cocoapods-tdf-bin/command/bin/archive.rb +222 -0
  8. data/lib/cocoapods-tdf-bin/command/bin/auto.rb +216 -0
  9. data/lib/cocoapods-tdf-bin/command/bin/code.rb +232 -0
  10. data/lib/cocoapods-tdf-bin/command/bin/imy.rb +46 -0
  11. data/lib/cocoapods-tdf-bin/command/bin/init.rb +69 -0
  12. data/lib/cocoapods-tdf-bin/command/bin/initHotKey.rb +70 -0
  13. data/lib/cocoapods-tdf-bin/command/bin/install.rb +44 -0
  14. data/lib/cocoapods-tdf-bin/command/bin/lib/lint.rb +69 -0
  15. data/lib/cocoapods-tdf-bin/command/bin/repo/update.rb +43 -0
  16. data/lib/cocoapods-tdf-bin/command/bin/spec/create.rb +73 -0
  17. data/lib/cocoapods-tdf-bin/command/bin/spec/push.rb +114 -0
  18. data/lib/cocoapods-tdf-bin/command/bin/update.rb +157 -0
  19. data/lib/cocoapods-tdf-bin/config/config.rb +138 -0
  20. data/lib/cocoapods-tdf-bin/config/config_asker.rb +57 -0
  21. data/lib/cocoapods-tdf-bin/config/config_builder.rb +238 -0
  22. data/lib/cocoapods-tdf-bin/config/config_hot_key.rb +103 -0
  23. data/lib/cocoapods-tdf-bin/config/config_hot_key_asker.rb +57 -0
  24. data/lib/cocoapods-tdf-bin/gem_version.rb +10 -0
  25. data/lib/cocoapods-tdf-bin/helpers.rb +5 -0
  26. data/lib/cocoapods-tdf-bin/helpers/Info.plist +0 -0
  27. data/lib/cocoapods-tdf-bin/helpers/build_helper.rb +162 -0
  28. data/lib/cocoapods-tdf-bin/helpers/build_utils.rb +101 -0
  29. data/lib/cocoapods-tdf-bin/helpers/framework.rb +85 -0
  30. data/lib/cocoapods-tdf-bin/helpers/framework_builder.rb +283 -0
  31. data/lib/cocoapods-tdf-bin/helpers/library.rb +54 -0
  32. data/lib/cocoapods-tdf-bin/helpers/library_builder.rb +90 -0
  33. data/lib/cocoapods-tdf-bin/helpers/sources_helper.rb +36 -0
  34. data/lib/cocoapods-tdf-bin/helpers/spec_creator.rb +168 -0
  35. data/lib/cocoapods-tdf-bin/helpers/spec_files_helper.rb +77 -0
  36. data/lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb +228 -0
  37. data/lib/cocoapods-tdf-bin/helpers/upload_helper.rb +89 -0
  38. data/lib/cocoapods-tdf-bin/native.rb +23 -0
  39. data/lib/cocoapods-tdf-bin/native/acknowledgements.rb +27 -0
  40. data/lib/cocoapods-tdf-bin/native/analyzer.rb +55 -0
  41. data/lib/cocoapods-tdf-bin/native/configuration.rb +26 -0
  42. data/lib/cocoapods-tdf-bin/native/file_accessor.rb +28 -0
  43. data/lib/cocoapods-tdf-bin/native/installation_options.rb +25 -0
  44. data/lib/cocoapods-tdf-bin/native/installer.rb +135 -0
  45. data/lib/cocoapods-tdf-bin/native/linter.rb +26 -0
  46. data/lib/cocoapods-tdf-bin/native/path_source.rb +33 -0
  47. data/lib/cocoapods-tdf-bin/native/pod_source_installer.rb +19 -0
  48. data/lib/cocoapods-tdf-bin/native/pod_target_installer.rb +94 -0
  49. data/lib/cocoapods-tdf-bin/native/podfile.rb +91 -0
  50. data/lib/cocoapods-tdf-bin/native/podfile_env.rb +37 -0
  51. data/lib/cocoapods-tdf-bin/native/podfile_generator.rb +199 -0
  52. data/lib/cocoapods-tdf-bin/native/podspec_finder.rb +25 -0
  53. data/lib/cocoapods-tdf-bin/native/resolver.rb +243 -0
  54. data/lib/cocoapods-tdf-bin/native/sandbox_analyzer.rb +34 -0
  55. data/lib/cocoapods-tdf-bin/native/source.rb +35 -0
  56. data/lib/cocoapods-tdf-bin/native/sources_manager.rb +20 -0
  57. data/lib/cocoapods-tdf-bin/native/specification.rb +31 -0
  58. data/lib/cocoapods-tdf-bin/native/target_validator.rb +41 -0
  59. data/lib/cocoapods-tdf-bin/native/validator.rb +40 -0
  60. data/lib/cocoapods-tdf-bin/source_provider_hook.rb +54 -0
  61. data/lib/cocoapods_plugin.rb +3 -0
  62. data/spec/command/bin_spec.rb +12 -0
  63. data/spec/spec_helper.rb +50 -0
  64. metadata +179 -0
@@ -0,0 +1,54 @@
1
+ require 'cocoapods-tdf-bin/native/sources_manager'
2
+ require 'cocoapods-tdf-bin/command/bin/repo/update'
3
+ require 'cocoapods/user_interface'
4
+
5
+ Pod::HooksManager.register('cocoapods-tdf-bin', :pre_install) do |_context, _|
6
+ require 'cocoapods-tdf-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-tdf-bin') && _context.podfile.configuration_env == 'dev'
13
+ dependencies = _context.podfile.dependencies
14
+ dependencies.each do |d|
15
+ next unless d.respond_to?(:external_source) &&
16
+ d.external_source.is_a?(Hash) &&
17
+ !d.external_source[:path].nil? &&
18
+ $ARGV[1] != 'archive'
19
+ _context.podfile.set_use_source_pods d.name
20
+ end
21
+ end
22
+
23
+ # 同步 BinPodfile 文件
24
+ project_root = Pod::Config.instance.project_root
25
+ path = File.join(project_root.to_s, 'BinPodfile')
26
+
27
+ next unless File.exist?(path)
28
+
29
+ contents = File.open(path, 'r:utf-8', &:read)
30
+ podfile = Pod::Config.instance.podfile
31
+ podfile.instance_eval do
32
+ begin
33
+ eval(contents, nil, path)
34
+ rescue Exception => e
35
+ message = "Invalid `#{path}` file: #{e.message}"
36
+ raise Pod::DSLError.new(message, path, e, contents)
37
+ end
38
+ end
39
+ end
40
+
41
+ Pod::HooksManager.register('cocoapods-tdf-bin', :source_provider) do |context, _|
42
+ sources_manager = Pod::Config.instance.sources_manager
43
+ podfile = Pod::Config.instance.podfile
44
+
45
+ if podfile
46
+ # 添加源码私有源 && 二进制私有源
47
+ added_sources = [sources_manager.code_source]
48
+ if podfile.use_binaries? || podfile.use_binaries_selector
49
+ added_sources << sources_manager.binary_source
50
+ added_sources.reverse!
51
+ end
52
+ added_sources.each { |source| context.add_source(source) }
53
+ end
54
+ end
@@ -0,0 +1,3 @@
1
+ require 'cocoapods-tdf-bin/gem_version.rb'
2
+ require 'cocoapods-tdf-bin/command'
3
+ require 'cocoapods-tdf-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,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-tdf-bin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - gaijiaofan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-06-07 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.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
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-tdf-bin is a plugin which helps develpers switching pods between
84
+ source code and binary.
85
+ email:
86
+ - suliangjin@xiaoyouzi.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - LICENSE.txt
92
+ - README.md
93
+ - lib/cocoapods-tdf-bin.rb
94
+ - lib/cocoapods-tdf-bin/command.rb
95
+ - lib/cocoapods-tdf-bin/command/bin.rb
96
+ - lib/cocoapods-tdf-bin/command/bin/archive.rb
97
+ - lib/cocoapods-tdf-bin/command/bin/auto.rb
98
+ - lib/cocoapods-tdf-bin/command/bin/code.rb
99
+ - lib/cocoapods-tdf-bin/command/bin/imy.rb
100
+ - lib/cocoapods-tdf-bin/command/bin/init.rb
101
+ - lib/cocoapods-tdf-bin/command/bin/initHotKey.rb
102
+ - lib/cocoapods-tdf-bin/command/bin/install.rb
103
+ - lib/cocoapods-tdf-bin/command/bin/lib/lint.rb
104
+ - lib/cocoapods-tdf-bin/command/bin/repo/update.rb
105
+ - lib/cocoapods-tdf-bin/command/bin/spec/create.rb
106
+ - lib/cocoapods-tdf-bin/command/bin/spec/push.rb
107
+ - lib/cocoapods-tdf-bin/command/bin/update.rb
108
+ - lib/cocoapods-tdf-bin/config/config.rb
109
+ - lib/cocoapods-tdf-bin/config/config_asker.rb
110
+ - lib/cocoapods-tdf-bin/config/config_builder.rb
111
+ - lib/cocoapods-tdf-bin/config/config_hot_key.rb
112
+ - lib/cocoapods-tdf-bin/config/config_hot_key_asker.rb
113
+ - lib/cocoapods-tdf-bin/gem_version.rb
114
+ - lib/cocoapods-tdf-bin/helpers.rb
115
+ - lib/cocoapods-tdf-bin/helpers/Info.plist
116
+ - lib/cocoapods-tdf-bin/helpers/build_helper.rb
117
+ - lib/cocoapods-tdf-bin/helpers/build_utils.rb
118
+ - lib/cocoapods-tdf-bin/helpers/framework.rb
119
+ - lib/cocoapods-tdf-bin/helpers/framework_builder.rb
120
+ - lib/cocoapods-tdf-bin/helpers/library.rb
121
+ - lib/cocoapods-tdf-bin/helpers/library_builder.rb
122
+ - lib/cocoapods-tdf-bin/helpers/sources_helper.rb
123
+ - lib/cocoapods-tdf-bin/helpers/spec_creator.rb
124
+ - lib/cocoapods-tdf-bin/helpers/spec_files_helper.rb
125
+ - lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb
126
+ - lib/cocoapods-tdf-bin/helpers/upload_helper.rb
127
+ - lib/cocoapods-tdf-bin/native.rb
128
+ - lib/cocoapods-tdf-bin/native/acknowledgements.rb
129
+ - lib/cocoapods-tdf-bin/native/analyzer.rb
130
+ - lib/cocoapods-tdf-bin/native/configuration.rb
131
+ - lib/cocoapods-tdf-bin/native/file_accessor.rb
132
+ - lib/cocoapods-tdf-bin/native/installation_options.rb
133
+ - lib/cocoapods-tdf-bin/native/installer.rb
134
+ - lib/cocoapods-tdf-bin/native/linter.rb
135
+ - lib/cocoapods-tdf-bin/native/path_source.rb
136
+ - lib/cocoapods-tdf-bin/native/pod_source_installer.rb
137
+ - lib/cocoapods-tdf-bin/native/pod_target_installer.rb
138
+ - lib/cocoapods-tdf-bin/native/podfile.rb
139
+ - lib/cocoapods-tdf-bin/native/podfile_env.rb
140
+ - lib/cocoapods-tdf-bin/native/podfile_generator.rb
141
+ - lib/cocoapods-tdf-bin/native/podspec_finder.rb
142
+ - lib/cocoapods-tdf-bin/native/resolver.rb
143
+ - lib/cocoapods-tdf-bin/native/sandbox_analyzer.rb
144
+ - lib/cocoapods-tdf-bin/native/source.rb
145
+ - lib/cocoapods-tdf-bin/native/sources_manager.rb
146
+ - lib/cocoapods-tdf-bin/native/specification.rb
147
+ - lib/cocoapods-tdf-bin/native/target_validator.rb
148
+ - lib/cocoapods-tdf-bin/native/validator.rb
149
+ - lib/cocoapods-tdf-bin/source_provider_hook.rb
150
+ - lib/cocoapods_plugin.rb
151
+ - spec/command/bin_spec.rb
152
+ - spec/spec_helper.rb
153
+ homepage: https://github.com/su350380433/cocaopods-imy-bin
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
157
+ post_install_message:
158
+ rdoc_options: []
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ requirements: []
172
+ rubygems_version: 3.2.11
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: cocoapods-tdf-bin is a plugin which helps develpers switching pods between
176
+ source code and binary.
177
+ test_files:
178
+ - spec/command/bin_spec.rb
179
+ - spec/spec_helper.rb