pod-builder 2.0.0.beta.29 → 2.0.0.beta.30

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: 54445e00ec8c44ad6d9223ec3da424542ba80a292d260832074c82bdee156001
4
- data.tar.gz: c1f8a2743f149b5b93988ede26dc24ac310950337cbba6171dfe617a241840db
3
+ metadata.gz: d4cde0acf0b503aaa846162710c25456d306b0ae6e53492b717795e4540f5b9f
4
+ data.tar.gz: ddfc897b5dd2d280a2b5e636706d62c854d01bb34f605b813d70a48ace6fad75
5
5
  SHA512:
6
- metadata.gz: e05523420cc3c9c0fb5ae88d18141d3df8d3db2526db282b5d5328e38dadd45da29a600668ef5fe2b71f0d21116e0544ce5c63dda47c3185570fd7643ef32e23
7
- data.tar.gz: b4cf94efd2e57b77f4e5068a15fcdc85bd0f25cd69d85f4169feaebd1dee83f55c6fb4e208733ff5a0b7c33c7ebea751c48684e96c2e9fa4fb55e67c4747b336
6
+ metadata.gz: 5f468d84983dc689b5dceef947da7d3ce586bd2d34be76ec439a236ba45435a6865b54d154233fdae038352ff1582cb68fcfdc520e5a101ed4842d86cde3e973
7
+ data.tar.gz: f45e9377fd79dff65b9c72580a29308172cc3cf3410093c2a6d2a7c9245c7000bc732b4d78473dd58ef14a3712a7cb9697bf87e7cd8331f8b413e0f550c04cc4
data/README.md CHANGED
@@ -300,18 +300,6 @@ PodBuilder writes a plist and markdown license files of pods specified in the Po
300
300
  }
301
301
  ```
302
302
 
303
- #### `subspecs_to_split`
304
-
305
- Normally when multiple subspecs are specified in a target a single framework is produced. There are rare cases where you specify different subspecs in different targets: a typical case is subspec specifically designed for app extensions, where you want to use a subspec in the main app and another one in the app extension.
306
-
307
- **Warning**: This will work properly only for static frameworks (_static_framework = true_ specified in the podspec). See [issue](https://github.com/CocoaPods/CocoaPods/issues/5708) and [issue](https://github.com/CocoaPods/CocoaPods/issues/5643)
308
-
309
- ```json
310
- {
311
- "subspecs_to_split": ["Podname1/Subspec1", "Podname1/Subspec2", "Podname2/Subspec1", "Podname2/Subspec1"]
312
- }
313
- ```
314
-
315
303
  #### `use_bundler`
316
304
 
317
305
  If you use bundler to pin the version of CocoaPods in your project set this to true. Default false.
@@ -79,6 +79,9 @@ Options:
79
79
  # opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
80
80
  # OPTIONS[:auto_resolve_dependencies] = o
81
81
  # end
82
+ opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
83
+ OPTIONS[:no_stdin_available] = o
84
+ end
82
85
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
83
86
  OPTIONS[:debug] = o
84
87
  end
@@ -108,6 +111,9 @@ Options:
108
111
  opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
109
112
  OPTIONS[:allow_warnings] = o
110
113
  end
114
+ opts.on("-s", "--no-stdin", "Never request interaction with sdtin (e.g. in CI environment)") do |o|
115
+ OPTIONS[:no_stdin_available] = o
116
+ end
111
117
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
112
118
  OPTIONS[:debug] = o
113
119
  end
@@ -49,34 +49,27 @@ module PodBuilder
49
49
 
50
50
  restore_file_error = Podfile.restore_file_sanity_check
51
51
 
52
- check_splitted_subspecs_are_buildable(all_buildable_items, installer)
53
52
  check_pods_exists(argument_pods, all_buildable_items)
54
53
 
55
54
  pods_to_build = resolve_pods_to_build(argument_pods, buildable_items)
56
55
  buildable_items -= pods_to_build
57
56
 
58
57
  # We need to split pods to build in 3 groups
59
- # 1. subspecs: because the resulting .framework path is treated differently when added to Configuration.subspecs_to_split
60
- # 2. pods to build in release
61
- # 3. pods to build in debug
58
+ # 1. pods to build in release
59
+ # 2. pods to build in debug
62
60
 
63
61
  check_not_building_development_pods(pods_to_build)
64
62
 
65
- pods_to_build_subspecs = splitted_pods_to_build(pods_to_build, installer)
66
-
67
63
  # Remove dependencies from pods to build
68
64
  all_dependencies_name = pods_to_build.map(&:dependency_names).flatten.uniq
69
65
  pods_to_build.select! { |x| !all_dependencies_name.include?(x.name) }
70
66
 
71
- pods_to_build -= pods_to_build_subspecs.flatten
72
67
  pods_to_build_debug = pods_to_build.select { |x| x.build_configuration == "debug" }
73
68
  pods_to_build_release = pods_to_build - pods_to_build_debug
74
69
 
75
70
  check_dependencies_build_configurations(all_buildable_items)
76
71
 
77
- podfiles_items = pods_to_build_subspecs
78
- podfiles_items.push(pods_to_build_debug)
79
- podfiles_items.push(pods_to_build_release)
72
+ podfiles_items = [pods_to_build_debug] + [pods_to_build_release]
80
73
 
81
74
  install_using_frameworks = Podfile::install_using_frameworks(analyzer)
82
75
 
@@ -125,20 +118,6 @@ module PodBuilder
125
118
 
126
119
  private
127
120
 
128
- def self.splitted_pods_to_build(pods_to_build, installer)
129
- specs_by_target = installer.analysis_result.specs_by_target
130
-
131
- pods_to_build_subspecs = pods_to_build.select { |x| x.is_subspec && Configuration.subspecs_to_split.include?(x.name) }
132
-
133
- pods = []
134
- specs_by_target.each do |target, specs|
135
- grouped = pods_to_build_subspecs.group_by { |t| specs.map(&:name).include?(t.name) }
136
- pods.push(grouped[true])
137
- end
138
-
139
- return pods.compact
140
- end
141
-
142
121
  def self.check_not_building_subspecs(pods_to_build)
143
122
  pods_to_build.each do |pod_to_build|
144
123
  if pod_to_build.include?("/")
@@ -156,55 +135,6 @@ module PodBuilder
156
135
  end
157
136
  end
158
137
 
159
- def self.check_splitted_subspecs_are_buildable(all_buildable_items, installer)
160
- check_splitted_subspecs_are_static(all_buildable_items)
161
- check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
162
- check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
163
- end
164
-
165
- def self.check_splitted_subspecs_have_valid_dependencies(all_buildable_items)
166
- splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
167
- splitted_items.each do |splitted_item|
168
- common_deps = splitted_item.dependency_names.select { |t| t.start_with?(splitted_item.root_name) }
169
-
170
- if common_deps.count > 0
171
- raise "\n\nSubspecs included in 'subspecs_to_split' cannot have dependencies to other subspecs within the spec.\n\n#{splitted_item.name} has dependencies to: '#{common_deps.join(', ')}'\n\n".red
172
- end
173
- end
174
- end
175
-
176
- def self.check_splitted_subspecs_not_in_multiple_targets(all_buildable_items, installer)
177
- specs_by_target = installer.analysis_result.specs_by_target
178
-
179
- flat_item_names = specs_by_target.values.flatten.map(&:name)
180
-
181
- splitted_items = all_buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
182
-
183
- splitted_items.each do |splitted_item|
184
- if flat_item_names.count(splitted_item.name) > 1
185
- raise "\n\n'#{splitted_item.name}' is included in 'subspecs_to_split' but it is used in multiple targets. This is unsupported.\nIf possible duplicate the subspec '#{splitted_item.name}' in the podspec using different names for each target.\n".red
186
- end
187
- end
188
- end
189
-
190
- def self.check_splitted_subspecs_are_static(all_buildable_items)
191
- non_static_subspecs = all_buildable_items.select { |x| x.is_subspec && x.is_static == false }
192
- non_static_subspecs_names = non_static_subspecs.map(&:name)
193
-
194
- invalid_subspecs = Configuration.subspecs_to_split & non_static_subspecs_names # intersect
195
-
196
- unless invalid_subspecs.count > 0
197
- return
198
- end
199
-
200
- warn_message = "The following pods `#{invalid_subspecs.join(" ")}` are non static binaries which are being splitted over different targets. Beware that this is an unsafe setup as per https://github.com/CocoaPods/CocoaPods/issues/5708 and https://github.com/CocoaPods/CocoaPods/issues/5643\n\nYou can ignore this error by passing the `--allow-warnings` flag to the build command\n"
201
- if OPTIONS[:allow_warnings]
202
- puts "\n\n#{warn_message}".yellow
203
- else
204
- raise "\n\n#{warn_message}".red
205
- end
206
- end
207
-
208
138
  def self.check_dependencies_build_configurations(pods)
209
139
  pods.each do |pod|
210
140
  pod_dependency_names = pod.dependency_names.select { |x| !pod.has_common_spec(x) }
@@ -31,19 +31,6 @@ module PodBuilder
31
31
  end
32
32
  end
33
33
 
34
- splitted_specs = buildable_items.select { |t| Configuration.subspecs_to_split.include?(t.name) }
35
- splitted_specs.each do |splitted_spec|
36
- root_name = splitted_spec.root_name
37
-
38
- Dir.glob(PodBuilder::prebuiltpath("#{root_name}/Subspecs/*")).each do |path|
39
- basename = File.basename(path)
40
- unless splitted_specs.map(&:podspec_name).include?(basename)
41
- puts "Cleanining up `#{root_name}/#{basename}`, no longer found among dependencies".blue
42
- PodBuilder::safe_rm_rf(path)
43
- end
44
- end
45
- end
46
-
47
34
  puts "Cleaning dSYM folder".yellow
48
35
  module_names = buildable_items.map(&:module_name).uniq
49
36
  Dir.glob(File.join(PodBuilder::dsympath, "**/*.dSYM")).each do |path|
@@ -78,7 +65,7 @@ module PodBuilder
78
65
 
79
66
  paths_to_delete.flatten.each do |path|
80
67
  confirm = ask("#{path} unused.\nDelete it? [Y/N] ") { |yn| yn.limit = 1, yn.validate = /[yn]/i }
81
- if confirm.downcase == 'y'
68
+ if confirm.downcase == 'y' || OPTIONS.has_key?(:no_stdin_available)
82
69
  PodBuilder::safe_rm_rf(path)
83
70
  end
84
71
  end
@@ -61,7 +61,6 @@ module PodBuilder
61
61
  attr_accessor :skip_pods
62
62
  attr_accessor :force_prebuild_pods
63
63
  attr_accessor :license_filename
64
- attr_accessor :subspecs_to_split
65
64
  attr_accessor :development_pods_paths
66
65
  attr_accessor :build_base_path
67
66
  attr_accessor :build_path
@@ -92,7 +91,6 @@ module PodBuilder
92
91
  @skip_pods = DEFAULT_SKIP_PODS
93
92
  @force_prebuild_pods = DEFAULT_FORCE_PREBUILD_PODS
94
93
  @license_filename = "Pods-acknowledgements"
95
- @subspecs_to_split = []
96
94
  @development_pods_paths = []
97
95
  @build_base_path = "/tmp/pod_builder".freeze
98
96
  @build_path = build_base_path
@@ -180,11 +178,6 @@ module PodBuilder
180
178
  Configuration.license_filename = value
181
179
  end
182
180
  end
183
- if value = json["subspecs_to_split"]
184
- if value.is_a?(Array) && value.count > 0
185
- Configuration.subspecs_to_split = value
186
- end
187
- end
188
181
  if value = json["project_name"]
189
182
  if value.is_a?(String) && value.length > 0
190
183
  Configuration.project_name = value
@@ -263,7 +256,6 @@ module PodBuilder
263
256
  config["build_system"] = Configuration.build_system
264
257
  config["library_evolution_support"] = Configuration.library_evolution_support
265
258
  config["license_filename"] = Configuration.license_filename
266
- config["subspecs_to_split"] = Configuration.subspecs_to_split
267
259
  config["restore_enabled"] = Configuration.restore_enabled
268
260
  config["allow_building_development_pods"] = Configuration.allow_building_development_pods
269
261
  config["use_bundler"] = Configuration.use_bundler
@@ -179,7 +179,7 @@ module PodBuilder
179
179
  if File.directory?("#{Configuration.build_path}/Pods/Pods.xcodeproj")
180
180
  if ENV['DEBUGGING']
181
181
  system("xed #{Configuration.build_path}/Pods")
182
- else
182
+ elsif !OPTIONS.has_key?(:no_stdin_available)
183
183
  confirm = ask("\n\nOh no! Something went wrong during prebuild phase! Do you want to open the prebuild project to debug the error, you will need to add and run the Pods-Dummy scheme? [Y/N] ".red) { |yn| yn.limit = 1, yn.validate = /[yn]/i }
184
184
  if confirm.downcase == 'y'
185
185
  system("xed #{Configuration.build_path}/Pods")
@@ -217,9 +217,6 @@ module PodBuilder
217
217
 
218
218
  podbuilder_file = File.join(path, Configuration.prebuilt_info_filename)
219
219
  entry = podfile_item.entry(true, false)
220
- if Configuration.subspecs_to_split.include?(podfile_item.name)
221
- entry.gsub!("'#{podfile_item.name}'", "'#{podfile_item.root_name}'")
222
- end
223
220
 
224
221
  data = {}
225
222
  data["entry"] = entry
@@ -313,11 +310,8 @@ module PodBuilder
313
310
  podspec_path = item.prebuilt_podspec_path
314
311
  if last_build_folder_hash = build_folder_hash_in_prebuilt_info_file(item)
315
312
  if last_build_folder_hash == build_folder_hash(item, gitignored_files)
316
- if Configuration.subspecs_to_split.include?(item.name)
317
- puts "No changes detected to '#{item.name}', will skip rebuild".blue
318
- else
319
- puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
320
- end
313
+ puts "No changes detected to '#{item.root_name}', will skip rebuild".blue
314
+
321
315
  replaced_items.push(item)
322
316
 
323
317
  podfile_items.select { |t| t.root_name == item.root_name }.each do |replace_item|
@@ -385,33 +379,21 @@ module PodBuilder
385
379
 
386
380
  non_prebuilt_items = podfile_items.reject(&:is_prebuilt)
387
381
 
388
- splitted_pods = non_prebuilt_items.map { |t| splitted_pod(t, podfile_items) }.flatten.uniq
389
- splitted_pods_root_name = splitted_pods.map { |t| t.root_name }.uniq
390
-
391
- pod_names = non_prebuilt_items.reject { |t| splitted_pods_root_name.include?(t.root_name) }.map(&:root_name).uniq + splitted_pods.map(&:name)
382
+ pod_names = non_prebuilt_items.map(&:root_name).uniq
392
383
 
393
384
  pod_names.reject! { |t|
394
385
  folder_path = PodBuilder::buildpath_prebuiltpath(t)
395
386
  File.directory?(folder_path) && Dir.empty?(folder_path) # When using prebuilt items we end up with empty folders
396
387
  }
397
388
 
398
- # Selectively delete destination folder.
399
- # If it's a splitted spec we just need to wipe the Subspecs/#{pod_name}
400
- # If it's not we need to wipe everything except the Subspecs folder
401
389
  pod_names.each do |pod_name|
402
390
  root_name = pod_name.split("/").first
403
- if pod_name.include?("/") # Splitted pod
404
- PodBuilder::safe_rm_rf(PodBuilder::prebuiltpath("#{root_name}/Subspecs/#{pod_name.gsub("/", "_") }"))
405
- else
406
- items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
407
- items_to_delete.reject! { |t| t.include?(PodBuilder::prebuiltpath("#{root_name}/Subspecs")) }
408
391
 
409
- items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
410
- end
392
+ items_to_delete = Dir.glob("#{PodBuilder::prebuiltpath(root_name)}/**/*")
393
+ items_to_delete.each { |t| PodBuilder::safe_rm_rf(t) }
411
394
  end
412
395
 
413
396
  # Now copy
414
- splitted_items_copied = false
415
397
  pod_names.each do |pod_name|
416
398
  root_name = pod_name.split("/").first
417
399
  source_path = PodBuilder::buildpath_prebuiltpath(root_name)
@@ -421,18 +403,9 @@ module PodBuilder
421
403
  next
422
404
  end
423
405
 
424
- if Configuration.subspecs_to_split.include?(pod_name)
425
- destination_folder = PodBuilder::prebuiltpath("#{root_name}/Subspecs/#{pod_name.gsub("/", "_") }")
426
- FileUtils.mkdir_p(destination_folder)
427
- unless splitted_items_copied
428
- FileUtils.cp_r("#{source_path}/.", destination_folder)
429
- splitted_items_copied = true
430
- end
431
- else
432
- destination_folder = PodBuilder::prebuiltpath(root_name)
433
- FileUtils.mkdir_p(destination_folder)
434
- FileUtils.cp_r("#{source_path}/.", destination_folder)
435
- end
406
+ destination_folder = PodBuilder::prebuiltpath(root_name)
407
+ FileUtils.mkdir_p(destination_folder)
408
+ FileUtils.cp_r("#{source_path}/.", destination_folder)
436
409
  end
437
410
 
438
411
  # Folder won't exist if no dSYM were generated (all static libs)
@@ -522,9 +495,5 @@ module PodBuilder
522
495
  return replace_path
523
496
  end
524
497
  end
525
-
526
- def self.splitted_pod(podfile_item, podfile_items)
527
- return podfile_items.select { |t| t.root_name == podfile_item.root_name && Configuration.subspecs_to_split.include?(t.name) }
528
- end
529
498
  end
530
499
  end
@@ -295,16 +295,14 @@ module PodBuilder
295
295
 
296
296
  root_names = deps.map(&:root_name).uniq
297
297
 
298
- unless Configuration.subspecs_to_split.include?(name)
299
- # We need to build all other common subspecs to properly build the item
300
- # Ex.
301
- # PodA depends on DepA/subspec1
302
- # PodB depends on DepA/subspec2
303
- #
304
- # When building PodA we need to build both DepA subspecs because they might
305
- # contain different code
306
- deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name && !Configuration.subspecs_to_split.include?(t.name) }
307
- end
298
+ # We need to build all other common subspecs to properly build the item
299
+ # Ex.
300
+ # PodA depends on DepA/subspec1
301
+ # PodB depends on DepA/subspec2
302
+ #
303
+ # When building PodA we need to build both DepA subspecs because they might
304
+ # contain different code
305
+ deps += available_pods.select { |t| root_names.include?(t.root_name) && t.root_name != t.name }
308
306
 
309
307
  deps.uniq!
310
308
 
@@ -406,11 +404,7 @@ module PodBuilder
406
404
  end
407
405
 
408
406
  def prebuilt_rel_path
409
- if is_subspec && Configuration.subspecs_to_split.include?(name)
410
- return "Subspecs/#{podspec_name}/#{module_name}.framework"
411
- else
412
- return "#{module_name}.framework"
413
- end
407
+ return "#{module_name}.framework"
414
408
  end
415
409
 
416
410
  def prebuilt_podspec_path(absolute_path = true)
@@ -24,16 +24,12 @@ module PodBuilder
24
24
  indentation = " " * slash_count
25
25
  spec_var = "p#{slash_count}"
26
26
 
27
- subspec_prefix = Configuration.subspecs_to_split.include?(item.name) ? "Subspecs/#{item.podspec_name}/" : ""
28
-
29
27
  if spec_var == "p1" && item.default_subspecs.count > 0
30
28
  podspec += "#{indentation}#{spec_var}.default_subspecs = '#{item.default_subspecs.join("', '")}'\n"
31
29
  end
32
30
 
33
- if subspec_prefix.length > 0 && Dir["#{PodBuilder::prebuiltpath("#{item.root_name}/#{subspec_prefix}")}/*"].empty?
34
- podspec += "#{indentation}#{spec_var}.source_files = '*.splittedspec'\n"
35
- elsif item.name == name
36
- if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{subspec_prefix}#{t}") || "") }
31
+ if item.name == name
32
+ if_exists = lambda { |t| File.exist?(PodBuilder::prebuiltpath("#{item.root_name}/#{t}") || "") }
37
33
 
38
34
  vendored_frameworks = item.vendored_frameworks
39
35
  if item.default_subspecs.count == 0 && install_using_frameworks
@@ -76,7 +72,7 @@ module PodBuilder
76
72
 
77
73
  entries = lambda { |spec_key, spec_value|
78
74
  key = "#{indentation}#{spec_var}.#{spec_key}"
79
- joined_values = spec_value.map { |t| "#{subspec_prefix}#{t}" }.uniq.sort.join("', '")
75
+ joined_values = spec_value.map { |t| "#{t}" }.uniq.sort.join("', '")
80
76
  "#{key} = '#{joined_values}'\n"
81
77
  }
82
78
 
@@ -180,7 +176,7 @@ module PodBuilder
180
176
  end
181
177
  end
182
178
 
183
- return podspec, (valid || Configuration.subspecs_to_split.include?(item.name))
179
+ return podspec, valid
184
180
  end
185
181
 
186
182
  def self.generate_podspec_from(all_buildable_items, platform, install_using_frameworks)
@@ -1,4 +1,4 @@
1
1
  module PodBuilder
2
- VERSION = "2.0.0.beta.29"
2
+ VERSION = "2.0.0.beta.30"
3
3
  end
4
4
 
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: 2.0.0.beta.29
4
+ version: 2.0.0.beta.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler