pod-builder 4.0.0 → 4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4eb5820c597538d2cdca26385c8d307d1ec1136d8c393594167fae25d1de240
4
- data.tar.gz: 8a489a9710bc41a6c96ec3603227cb06e0a9d376835f05976c5e595bd45d902e
3
+ metadata.gz: a78cc17a913b3034855029cd54e3b27ab7f5e4482c370e7a53c527c902bec7f1
4
+ data.tar.gz: '08abdad59a5fc4a09dd86fb3d0ca36dc93ef5f3c66a47505fc0919245f8cfd14'
5
5
  SHA512:
6
- metadata.gz: 3ed8a52ba842937a2a24626c55bd67932c9a2a2af80b8b3891dd00109597e42251e4eea694b4c4f5901218de22ec6b21ae95a87f5e9f034e4467c4d9e9c8c0b3
7
- data.tar.gz: 00ac3c4c7c07716d84011dab03b5524e4154172bae3ecac9cce228b2b78047738c5037f057e0d14fb0e0779b29090f83b0b8df0c3e7f9f77a59369cf954db99c
6
+ metadata.gz: 98738c77905e22cfc84ac3941347ab23b9fb1a6f5bb3e9a807b85795b8378f9e4cc2d31f75d1bc338f1ab828a6264f262ef01cd0efc0e4e075a8cfea80981c15
7
+ data.tar.gz: a2561e7991129a01f1fddc79a23e72a87af1474528d188bc686362a6040e0e798e4f66e2e882b5a273342cbf70a035554673e39cf125f0f12302f44e1625944e
@@ -52,7 +52,10 @@ module PodBuilder
52
52
 
53
53
  supported_platforms = analyzer.instance_variable_get("@result").targets.map { |t| t.platform.safe_string_name.downcase }
54
54
 
55
- return all_specs.map { |spec| PodfileItem.new(spec, all_specs, checkout_options, supported_platforms) }.sort_by(&:name)
55
+ target_definitions = installer.podfile.target_definitions.values
56
+ items = all_specs.map { |spec| PodfileItem.new(spec, all_specs, target_definitions, checkout_options, supported_platforms) }.sort_by(&:name)
57
+
58
+ return items
56
59
  end
57
60
  end
58
61
  end
@@ -1,4 +1,5 @@
1
1
  require 'pod_builder/core'
2
+ require 'set'
2
3
 
3
4
  module PodBuilder
4
5
  module Command
@@ -87,6 +88,8 @@ module PodBuilder
87
88
  pod_names_to_switch = pod_names_to_switch.map { |t| t.split("/").first }.uniq
88
89
  dep_pod_names_to_switch.reject { |t| pod_names_to_switch.include?(t) }
89
90
  end
91
+
92
+ inhibit_warnings = inhibit_warnings_pods()
90
93
 
91
94
  pod_names_to_switch.each do |pod_name_to_switch|
92
95
  development_path = ""
@@ -94,7 +97,7 @@ module PodBuilder
94
97
 
95
98
  case OPTIONS[:switch_mode]
96
99
  when "development"
97
- development_path = find_podspec(pod_name_to_switch)
100
+ development_path = find_podspec(pod_name_to_switch)
98
101
  when "prebuilt"
99
102
  podfile_path = PodBuilder::basepath("Podfile.restore")
100
103
  content = File.read(podfile_path)
@@ -113,8 +116,7 @@ module PodBuilder
113
116
  next
114
117
  end
115
118
 
116
- matches = line.gsub("\"", "'").match(/pod '(.*?)'/)
117
- if matches&.size == 2
119
+ if (matches = line.match(/^\s*pod ['|"](.*?)['|"](.*)/)) && matches.size == 3
118
120
  if matches[1].split("/").first == pod_name_to_switch
119
121
  default_entries[current_section] = line
120
122
  end
@@ -143,8 +145,7 @@ module PodBuilder
143
145
  current_section = line.split(" ")[1]
144
146
  end
145
147
 
146
- matches = line.gsub("\"", "'").match(/pod '(.*?)'/)
147
- if matches&.size == 2
148
+ if (matches = line.match(/^\s*pod ['|"](.*?)['|"](.*)/)) && matches.size == 3
148
149
  if matches[1].split("/").first == pod_name_to_switch
149
150
  case OPTIONS[:switch_mode]
150
151
  when "prebuilt"
@@ -161,6 +162,9 @@ module PodBuilder
161
162
  indentation = line.split("pod '").first
162
163
  rel_path = Pathname.new(development_path).relative_path_from(Pathname.new(PodBuilder::project_path)).to_s
163
164
  development_line = "#{indentation}pod '#{matches[1]}', :path => '#{rel_path}'\n"
165
+ if inhibit_warnings.include?(matches[1])
166
+ development_line = development_line.chomp("\n") + ", :inhibit_warnings => true\n"
167
+ end
164
168
  if line.include?("# pb<") && marker = line.split("# pb<").last
165
169
  development_line = development_line.chomp("\n") + " # pb<#{marker}"
166
170
  end
@@ -169,6 +173,9 @@ module PodBuilder
169
173
  next
170
174
  when "default"
171
175
  if default_line = default_entries[current_section]
176
+ if inhibit_warnings.include?(matches[1])
177
+ default_line = default_line.chomp("\n") + ", :inhibit_warnings => true\n"
178
+ end
172
179
  if line.include?("# pb<") && marker = line.split("# pb<").last
173
180
  default_line = default_line.chomp("\n") + " # pb<#{marker}"
174
181
  end
@@ -182,8 +189,6 @@ module PodBuilder
182
189
 
183
190
  lines.append(default_line)
184
191
  next
185
- elsif
186
- raise "\n\nLine for pod '#{matches[1]}' in section '#{current_section}' not found in PodBuilder's Podfile".red
187
192
  end
188
193
  else
189
194
  raise "\n\nUnsupported mode '#{OPTIONS[:switch_mode]}'".red
@@ -210,6 +215,26 @@ module PodBuilder
210
215
  end
211
216
 
212
217
  private
218
+
219
+ def self.inhibit_warnings_pods
220
+ ret = Set.new
221
+
222
+ podfile_path = PodBuilder::basepath("Podfile")
223
+ content = File.read(podfile_path)
224
+
225
+ content.each_line do |line|
226
+ unless (name_match = line.match(/^\s*pod ['|"](.*?)['|"](.*)/)) && name_match.size == 3
227
+ next
228
+ end
229
+
230
+ if line.gsub(" ", "").include?(":inhibit_warnings=>true")
231
+ pod_name = name_match[1]
232
+ ret.add?(pod_name)
233
+ end
234
+ end
235
+
236
+ return ret
237
+ end
213
238
 
214
239
  def self.is_absolute_path(path)
215
240
  return ["~", "/"].any? { |t| path.start_with?(t) }
@@ -142,6 +142,10 @@ module PodBuilder
142
142
  # @return [Bool] True if it's a pod that doesn't provide source code (is already shipped as a prebuilt pod)
143
143
  #
144
144
  attr_accessor :is_prebuilt
145
+
146
+ # @return [Bool] True if warnings should be inhibited for the pod
147
+ #
148
+ attr_accessor :inhibit_warnings
145
149
 
146
150
  # Initialize a new instance
147
151
  #
@@ -149,7 +153,7 @@ module PodBuilder
149
153
  #
150
154
  # @param [Hash] checkout_options
151
155
  #
152
- def initialize(spec, all_specs, checkout_options, supported_platforms)
156
+ def initialize(spec, all_specs, target_definitions, checkout_options, supported_platforms)
153
157
  @name = spec.name
154
158
  @root_name = spec.name.split("/").first
155
159
 
@@ -264,6 +268,7 @@ module PodBuilder
264
268
  @build_xcframework = build_as_xcframework
265
269
 
266
270
  @is_prebuilt = extract_is_prebuilt(spec, all_specs, checkout_options, supported_platforms)
271
+ @inhibit_warnings = target_definitions.any? { |t| t.inhibits_warnings_for_pod?(@name) }
267
272
  end
268
273
 
269
274
  def pod_specification(all_poditems, parent_spec = nil)
@@ -370,6 +375,10 @@ module PodBuilder
370
375
  def entry(include_version = true, include_pb_entry = true)
371
376
  e = "pod '#{@name}'"
372
377
 
378
+ if !is_prebuilt && inhibit_warnings
379
+ e += ", :inhibit_warnings => true"
380
+ end
381
+
373
382
  unless include_version
374
383
  return e
375
384
  end
@@ -478,7 +487,7 @@ module PodBuilder
478
487
  if default_subspecs != nil && default_subspecs.count > 0
479
488
  default_subspecs.each do |default_subspec_name|
480
489
  if (default_spec = all_specs.detect { |t| t.name == "#{root_name}/#{default_subspec_name}" })
481
- default_item = PodfileItem.new(default_spec, all_specs, checkout_options, supported_platforms)
490
+ default_item = PodfileItem.new(default_spec, all_specs, [], checkout_options, supported_platforms)
482
491
  if default_item.is_prebuilt
483
492
  return true
484
493
  end
@@ -1,3 +1,3 @@
1
1
  module PodBuilder
2
- VERSION = "4.0.0"
2
+ VERSION = "4.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  requirements: []
237
- rubygems_version: 3.0.3
237
+ rubygems_version: 3.1.2
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: Prebuild CocoaPods pods