cocoapods-bb-bin 0.1.9.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5f4829bed047a7e6cf24fa37682af5fc4dc8072f1007816fd4583c61905d05c
4
- data.tar.gz: bec7974a90a79e8b5c6568603f754ede81499d5e1ddee4f2822b31acc2982839
3
+ metadata.gz: 4926e04b2eaade743939e92c8de3707bdaf3444b06b9515aa45278b63c444df8
4
+ data.tar.gz: 677d14354d6f11f34a30e956c515f9b9db5040076cdbf2902a71ed9ff3badd65
5
5
  SHA512:
6
- metadata.gz: c0defbc5c9f7cdfcca836b01ed21eab3af214eab878c1cbebe77e7089b6777f0b3a7e8f79af402c2bc3364ea8813d1eb56d2ee4415e9d84e211c57986c6fafbd
7
- data.tar.gz: d4fa411c0be901eff6028216f351c3678e1f95be435afea6301e5dcd33aa89ddd0d242151d62f1e3850f52400aa365aaddf5a97040b5af097d8008138df23605
6
+ metadata.gz: bc1d214967a7056d24836d7162bc5140c771575f1a4f0c59f90b91a47d782ba506069fadb22c35cdf2f4b13a1d6aca9e63595c4c51b068836135a19b30795c0d
7
+ data.tar.gz: c625ef1d42a31eef96e0f9fc492ddd21066dd59ff35d88a2529f227466ca533cdaf276dbecfe136870abc916e7448fc9dcc381ca958635174b7d8a3785b909ea
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CBin
3
- VERSION = '0.1.9.2'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
 
6
6
  module Pod
@@ -43,15 +43,22 @@ module CBin
43
43
  end
44
44
 
45
45
  @filename = file
46
+ # 拷贝二进制spec到源码spec by hm 22/1/19
47
+ `cp -fa #{file} #{sourceSpecFilePath}`
46
48
  end
47
49
 
48
50
  def clear_spec_file
49
51
  File.delete(filename) if File.exist?(filename)
50
52
  end
51
53
 
54
+ # 二进制spec路径
52
55
  def filename
53
56
  @filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.binary.podspec.json"
54
57
  end
58
+ # 源码spec路径(指向二进制库)
59
+ def sourceSpecFilePath
60
+ @filename ||= "#{CBin::Config::Builder.instance.binary_json_dir_name}/#{spec.name}.podspec.json"
61
+ end
55
62
 
56
63
  private
57
64
 
@@ -15,18 +15,16 @@ module Pod
15
15
  class PodfileGenerator
16
16
  # @return [Podfile] a podfile suitable for installing the given spec
17
17
  #
18
- # @param [Specification] spec
18
+ # @param [Array<Specification>] specs
19
19
  #
20
- alias old_podfile_for_spec podfile_for_spec
21
-
22
- def podfile_for_spec(spec)
20
+ def podfile_for_specs(specs)
23
21
  generator = self
24
- dir = configuration.gen_dir_for_pod(spec.name)
25
- project_name = configuration.project_name_for_spec(spec)
22
+ dir = configuration.gen_dir_for_specs(specs)
23
+ project_name = configuration.project_name_for_specs(specs)
26
24
 
27
25
  Pod::Podfile.new do
28
26
  project "#{project_name}.xcodeproj"
29
- workspace "#{spec.name}.xcworkspace"
27
+ workspace "#{project_name}.xcworkspace"
30
28
 
31
29
  plugin 'cocoapods-generate'
32
30
 
@@ -35,8 +33,8 @@ module Pod
35
33
  generator.podfile_plugins.each do |name, options|
36
34
  plugin(*[name, options].compact)
37
35
  end
38
- # Pod::UI::puts "====use_frameworks:#{generator.configuration.use_frameworks?}"
39
- use_frameworks!(generator.configuration.use_frameworks?)
36
+
37
+ use_frameworks!(generator.use_frameworks_value)
40
38
 
41
39
  if (supported_swift_versions = generator.supported_swift_versions)
42
40
  supports_swift_versions(supported_swift_versions)
@@ -49,44 +47,51 @@ module Pod
49
47
 
50
48
  self.defined_in_file = dir.join('CocoaPods.podfile.yaml')
51
49
 
52
- test_specs = spec.recursive_subspecs.select(&:test_specification?)
53
- app_specs = if spec.respond_to?(:app_specification?)
54
- spec.recursive_subspecs.select(&:app_specification?)
55
- else
56
- []
57
- end
50
+ test_specs_by_spec = Hash[specs.map do |spec|
51
+ [spec, spec.recursive_subspecs.select(&:test_specification?)]
52
+ end]
53
+ app_specs_by_spec = Hash[specs.map do |spec|
54
+ app_specs = if spec.respond_to?(:app_specification?)
55
+ spec.recursive_subspecs.select(&:app_specification?)
56
+ else
57
+ []
58
+ end
59
+ [spec, app_specs]
60
+ end]
58
61
 
59
62
  # Stick all of the transitive dependencies in an abstract target.
60
63
  # This allows us to force CocoaPods to use the versions / sources / external sources
61
64
  # that we want.
62
- # By using an abstract target,
63
-
65
+
64
66
  # 会导致多个dependencies出现, 注释by slj
65
67
  # abstract_target 'Transitive Dependencies' do
66
- # pods_for_transitive_dependencies = [spec.name]
67
- # .concat(test_specs.map(&:name))
68
- # .concat(test_specs.flat_map { |ts| ts.dependencies.flat_map(&:name) })
69
- # .concat(app_specs.map(&:name))
70
- # .concat(app_specs.flat_map { |as| as.dependencies.flat_map(&:name) })
71
- #
68
+ # pods_for_transitive_dependencies = specs.flat_map do |spec|
69
+ # [spec.name]
70
+ # .concat(test_specs_by_spec.keys.map(&:name))
71
+ # .concat(test_specs_by_spec.values.flatten.flat_map { |ts| ts.dependencies.flat_map(&:name) })
72
+ # .concat(app_specs_by_spec.keys.map(&:name))
73
+ # .concat(app_specs_by_spec.values.flatten.flat_map { |as| as.dependencies.flat_map(&:name) })
74
+ # end
75
+ # pods_for_transitive_dependencies.uniq!
76
+
77
+ # spec_names = specs.map { |s| s.root.name }.to_set
72
78
  # dependencies = generator
73
- # .transitive_dependencies_by_pod
74
- # .values_at(*pods_for_transitive_dependencies)
75
- # .compact
76
- # .flatten(1)
77
- # .uniq
78
- # .sort_by(&:name)
79
- # .reject { |d| d.root_name == spec.root.name }
80
- #
79
+ # .transitive_dependencies_by_pod
80
+ # .values_at(*pods_for_transitive_dependencies)
81
+ # .compact
82
+ # .flatten(1)
83
+ # .uniq
84
+ # .sort_by(&:name)
85
+ # .reject { |d| spec_names.include?(d.root_name) }
86
+
81
87
  # dependencies.each do |dependency|
82
88
  # pod_args = generator.pod_args_for_dependency(self, dependency)
83
89
  # pod(*pod_args)
84
90
  # end
85
91
  # end
86
92
 
87
- # Add platform-specific concrete targets that inherit the
88
- # `pod` declaration for the local pod.
89
- spec_platform_names = spec.available_platforms.map(&:string_name).flatten.each.reject do |platform_name|
93
+ # Add platform-specific concrete targets that inherit the `pod` declaration for the local pod.
94
+ spec_platform_names = specs.flat_map { |s| s.available_platforms.map(&:string_name) }.uniq.each.reject do |platform_name|
90
95
  !generator.configuration.platforms.nil? && !generator.configuration.platforms.include?(platform_name.downcase)
91
96
  end
92
97
 
@@ -98,8 +103,16 @@ module Pod
98
103
 
99
104
  # this block has to come _before_ inhibit_all_warnings! / use_modular_headers!,
100
105
  # and the local `pod` declaration
101
- # 会导致多个dependencies出现, 注释by slj
102
-
106
+ # current_target_definition.instance_exec do
107
+ # transitive_dependencies = children.find { |c| c.name == 'Transitive Dependencies' }
108
+
109
+ # %w[use_modular_headers inhibit_warnings].each do |key|
110
+ # Pod::UI::puts "====key:#{key} value:#{value}"
111
+ # value = transitive_dependencies.send(:internal_hash).delete(key)
112
+ # next if value.blank?
113
+ # set_hash_value(key, value)
114
+ # end
115
+ # end
103
116
 
104
117
  inhibit_all_warnings! if generator.inhibit_all_warnings?
105
118
  # use_modular_headers! if generator.use_modular_headers?
@@ -112,15 +125,18 @@ module Pod
112
125
  use_modular_headers!
113
126
  end
114
127
 
115
- # This is the pod declaration for the local pod,
116
- # it will be inherited by the concrete target definitions below
117
- pod_options = generator.dependency_compilation_kwargs(spec.name)
118
- pod_options[:path] = spec.defined_in_file.relative_path_from(dir).to_s
119
- { testspecs: test_specs, appspecs: app_specs }.each do |key, specs|
120
- pod_options[key] = specs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless specs.empty?
121
- end
128
+ specs.each do |spec|
129
+ # This is the pod declaration for the local pod,
130
+ # it will be inherited by the concrete target definitions below
131
+ pod_options = generator.dependency_compilation_kwargs(spec.name)
122
132
 
123
- pod spec.name, **pod_options
133
+ path = spec.defined_in_file.relative_path_from(dir).to_s
134
+ pod_options[:path] = path
135
+ { testspecs: test_specs_by_spec[spec], appspecs: app_specs_by_spec[spec] }.each do |key, subspecs|
136
+ pod_options[key] = subspecs.map { |s| s.name.sub(%r{^#{Regexp.escape spec.root.name}/}, '') }.sort unless subspecs.blank?
137
+ end
138
+ pod spec.name, **pod_options
139
+ end
124
140
 
125
141
  if Pod::Config.instance.podfile
126
142
  target_definitions['Pods'].instance_exec do
@@ -187,14 +203,16 @@ module Pod
187
203
 
188
204
  # Implement local-sources option to set up dependencies to podspecs in the local filesystem.
189
205
  next if generator.configuration.local_sources.empty?
190
- generator.transitive_local_dependencies(spec, generator.configuration.local_sources).each do |dependency, podspec_file|
191
- pod_options = generator.dependency_compilation_kwargs(dependency.name)
192
- pod_options[:path] = if podspec_file[0] == '/' # absolute path
193
- podspec_file
194
- else
195
- '../../' + podspec_file
196
- end
197
- pod dependency.name, **pod_options
206
+ specs.each do |spec|
207
+ generator.transitive_local_dependencies(spec, generator.configuration.local_sources).sort_by(&:first).each do |dependency, podspec_file|
208
+ pod_options = generator.dependency_compilation_kwargs(dependency.name)
209
+ pod_options[:path] = if podspec_file[0] == '/' # absolute path
210
+ podspec_file
211
+ else
212
+ '../../' + podspec_file
213
+ end
214
+ pod dependency.name, **pod_options
215
+ end
198
216
  end
199
217
  end
200
218
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-bb-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - humin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-03 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: cocoapods-generate
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '2.2'
54
+ - - "<"
52
55
  - !ruby/object:Gem::Version
53
- version: 2.0.1
56
+ version: '3.0'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '2.2'
64
+ - - "<"
59
65
  - !ruby/object:Gem::Version
60
- version: 2.0.1
66
+ version: '3.0'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: cocoapods-bb-xcframework
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
203
  - !ruby/object:Gem::Version
198
204
  version: '0'
199
205
  requirements: []
200
- rubygems_version: 3.2.30
206
+ rubygems_version: 3.3.5
201
207
  signing_key:
202
208
  specification_version: 4
203
209
  summary: cocoapods-bb-bin is a plugin which helps develpers switching pods between