pod-builder 1.9.2 → 2.0.0.beta.19

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -0
  3. data/Example/Frameworks/.gitignore +6 -0
  4. data/Example/Frameworks/.pod_builder/pod_builder +0 -0
  5. data/Example/Frameworks/PodBuilder.json +10 -4
  6. data/Example/Frameworks/Podfile +23 -0
  7. data/Example/Frameworks/Podfile.restore +40 -0
  8. data/Example/PodBuilderExample.xcodeproj/project.pbxproj +3 -8
  9. data/Example/{PodBuilderExample.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist → PodBuilderExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist} +2 -8
  10. data/Example/PodBuilderExample/AppDelegate.swift +4 -0
  11. data/Example/Podfile +44 -1
  12. data/Example/Podfile.lock +426 -7
  13. data/Example/Pods-acknowledgements.md +210 -0
  14. data/Example/Pods-acknowledgements.plist +206 -0
  15. data/README.md +38 -1
  16. data/exe/pod_builder +14 -14
  17. data/lib/pod_builder/analyze.rb +32 -7
  18. data/lib/pod_builder/analyzer.rb +16 -0
  19. data/lib/pod_builder/command/build.rb +110 -96
  20. data/lib/pod_builder/command/clean.rb +9 -11
  21. data/lib/pod_builder/command/clear_lldbinit.rb +1 -1
  22. data/lib/pod_builder/command/deintegrate.rb +2 -1
  23. data/lib/pod_builder/command/generate_lfs.rb +2 -2
  24. data/lib/pod_builder/command/install_sources.rb +1 -1
  25. data/lib/pod_builder/command/switch.rb +99 -99
  26. data/lib/pod_builder/command/sync_podfile.rb +2 -1
  27. data/lib/pod_builder/command/update.rb +1 -1
  28. data/lib/pod_builder/command/update_lldbinit.rb +2 -2
  29. data/lib/pod_builder/configuration.rb +62 -7
  30. data/lib/pod_builder/core.rb +60 -5
  31. data/lib/pod_builder/info.rb +24 -90
  32. data/lib/pod_builder/install.rb +149 -83
  33. data/lib/pod_builder/podfile.rb +87 -14
  34. data/lib/pod_builder/podfile/post_actions.rb +0 -1
  35. data/lib/pod_builder/podfile_item.rb +152 -74
  36. data/lib/pod_builder/podspec.rb +125 -133
  37. data/lib/pod_builder/rome/post_install.rb +248 -0
  38. data/lib/pod_builder/rome/pre_install.rb +6 -0
  39. data/lib/pod_builder/templates/build_podfile.template +1 -1
  40. data/lib/pod_builder/version.rb +1 -1
  41. data/pod-builder.gemspec +4 -4
  42. metadata +32 -64
  43. data/Example/Pods/Alamofire/LICENSE +0 -19
  44. data/Example/Pods/Alamofire/README.md +0 -242
  45. data/Example/Pods/Alamofire/Source/AFError.swift +0 -460
  46. data/Example/Pods/Alamofire/Source/Alamofire.swift +0 -465
  47. data/Example/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +0 -37
  48. data/Example/Pods/Alamofire/Source/MultipartFormData.swift +0 -580
  49. data/Example/Pods/Alamofire/Source/NetworkReachabilityManager.swift +0 -233
  50. data/Example/Pods/Alamofire/Source/Notifications.swift +0 -55
  51. data/Example/Pods/Alamofire/Source/ParameterEncoding.swift +0 -483
  52. data/Example/Pods/Alamofire/Source/Request.swift +0 -654
  53. data/Example/Pods/Alamofire/Source/Response.swift +0 -567
  54. data/Example/Pods/Alamofire/Source/ResponseSerialization.swift +0 -715
  55. data/Example/Pods/Alamofire/Source/Result.swift +0 -300
  56. data/Example/Pods/Alamofire/Source/ServerTrustPolicy.swift +0 -307
  57. data/Example/Pods/Alamofire/Source/SessionDelegate.swift +0 -725
  58. data/Example/Pods/Alamofire/Source/SessionManager.swift +0 -896
  59. data/Example/Pods/Alamofire/Source/TaskDelegate.swift +0 -466
  60. data/Example/Pods/Alamofire/Source/Timeline.swift +0 -136
  61. data/Example/Pods/Alamofire/Source/Validation.swift +0 -315
  62. data/Example/Pods/Manifest.lock +0 -16
  63. data/Example/Pods/Pods.xcodeproj/project.pbxproj +0 -673
  64. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Alamofire.xcscheme +0 -60
  65. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/Pods-PodBuilderExample.xcscheme +0 -60
  66. data/Example/Pods/Pods.xcodeproj/xcuserdata/tomas.xcuserdatad/xcschemes/xcschememanagement.plist +0 -21
  67. data/Example/Pods/Target Support Files/Alamofire/Alamofire-dummy.m +0 -5
  68. data/Example/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch +0 -12
  69. data/Example/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +0 -16
  70. data/Example/Pods/Target Support Files/Alamofire/Alamofire.modulemap +0 -6
  71. data/Example/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +0 -9
  72. data/Example/Pods/Target Support Files/Alamofire/Info.plist +0 -26
  73. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Info.plist +0 -26
  74. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.markdown +0 -26
  75. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-acknowledgements.plist +0 -58
  76. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-dummy.m +0 -5
  77. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-frameworks.sh +0 -153
  78. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-resources.sh +0 -118
  79. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample-umbrella.h +0 -16
  80. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.debug.xcconfig +0 -11
  81. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.modulemap +0 -6
  82. data/Example/Pods/Target Support Files/Pods-PodBuilderExample/Pods-PodBuilderExample.release.xcconfig +0 -11
  83. data/lib/pod_builder/cocoapods/specification.rb +0 -27
@@ -71,12 +71,15 @@ Options:
71
71
  opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
72
72
  OPTIONS[:update_repos] = false
73
73
  end
74
+ opts.on("-f", "--force", "Rebuild frameworks evan if no code change is detected") do |o|
75
+ OPTIONS[:force_rebuild] = false
76
+ end
74
77
  opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
75
78
  OPTIONS[:allow_warnings] = o
76
79
  end
77
- opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
78
- OPTIONS[:auto_resolve_dependencies] = o
79
- end
80
+ # opts.on("-a", "--auto-resolve-deps", "Resolve pod dependencies automatically") do |o|
81
+ # OPTIONS[:auto_resolve_dependencies] = o
82
+ # end
80
83
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
81
84
  OPTIONS[:debug] = o
82
85
  end
@@ -100,6 +103,9 @@ Options:
100
103
  opts.on("-u", "--skip-repo-update", "Skip CocoaPods repo update") do |o|
101
104
  OPTIONS[:update_repos] = false
102
105
  end
106
+ opts.on("-f", "--force", "Rebuild frameworks evan if no code change is detected") do |o|
107
+ OPTIONS[:force_rebuild] = false
108
+ end
103
109
  opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
104
110
  OPTIONS[:allow_warnings] = o
105
111
  end
@@ -289,9 +295,9 @@ Usage:
289
295
  opts.banner = "
290
296
  Usage:
291
297
 
292
- $ pod_builder switch PODNAME [OPTIONS]
298
+ $ pod_builder switch [OPTIONS] PODNAME[s]
293
299
 
294
- Switch integration between prebuilt/development/default pod version.
300
+ Switch integration between prebuilt/development/default pod version. Multiple space separated pods can be passed
295
301
 
296
302
  Options:
297
303
  "
@@ -357,6 +363,8 @@ Usage:
357
363
  else
358
364
  PodBuilder::Configuration.load
359
365
 
366
+ PodBuilder::add_lockfile
367
+
360
368
  subcommand[:opts].order!
361
369
  subcommand[:call].each do |k|
362
370
  if (ret = k.call(OPTIONS)) && ret == -1
@@ -374,8 +382,6 @@ begin
374
382
  raise "\n\nFor safety do not run this as root\n".red
375
383
  end
376
384
 
377
- PodBuilder::add_lock_file
378
- valid_lock_file = true
379
385
  command_ret = parse_commandline
380
386
  rescue Exception => e
381
387
  error = e.to_s
@@ -392,14 +398,8 @@ rescue Exception => e
392
398
  ensure
393
399
  if command_ret == 0
394
400
  PodBuilder::clean_basepath
395
-
396
- if !OPTIONS.has_key?(:debug)
397
- PodBuilder::safe_rm_rf(PodBuilder::Configuration.build_path)
398
- end
399
- end
400
- if valid_lock_file
401
- PodBuilder::remove_lock_file
402
401
  end
402
+ PodBuilder::remove_lockfile
403
403
 
404
404
  exit(command_ret)
405
405
  end
@@ -1,4 +1,6 @@
1
- require 'pod_builder/cocoapods/specification'
1
+ require 'rubygems/specification'
2
+ require 'pod_builder/rome/pre_install.rb'
3
+ require 'pod_builder/rome/post_install.rb'
2
4
 
3
5
  module PodBuilder
4
6
  class Analyze
@@ -6,6 +8,14 @@ module PodBuilder
6
8
  #
7
9
  def self.installer_at(path, repo_update = false)
8
10
  CLAide::Command::PluginManager.load_plugins("cocoapods")
11
+
12
+ # Manually load inline podbuilder-rome plugin
13
+ pluginspec = Gem::Specification.new("podbuilder-rome", PodBuilder::VERSION)
14
+ pluginspec.activate
15
+
16
+ if !CLAide::Command::PluginManager.loaded_plugins["cocoapods"].map(&:name).include?(pluginspec.name)
17
+ CLAide::Command::PluginManager.loaded_plugins["cocoapods"].push(pluginspec)
18
+ end
9
19
 
10
20
  current_dir = Dir.pwd
11
21
  Dir.chdir(path)
@@ -40,15 +50,30 @@ module PodBuilder
40
50
  checkout_options.merge!(analyzer.sandbox.checkout_sources)
41
51
 
42
52
  all_specs = analysis_result.specifications
53
+
54
+ supported_platforms = analyzer.instance_variable_get("@result").targets.map { |t| t.platform.safe_string_name.downcase }
55
+ all_podfile_items = all_specs.map { |spec| PodfileItem.new(spec, all_specs, checkout_options, supported_platforms) }
43
56
 
44
- all_podfile_specs = all_specs.select { |x| all_podfile_pods.map(&:name).include?(x.name) }
57
+ names = analyzer.explicit_pods().map(&:name)
45
58
 
46
- deps_names = all_podfile_specs.map { |x| x.recursive_dep_names(all_specs) }.flatten.uniq
59
+ podfile_pods = []
60
+ last_count = -1
61
+ while podfile_pods.count != last_count do
62
+ last_count = podfile_pods.count
47
63
 
48
- all_podfile_specs += all_specs.select { |x| deps_names.include?(x.name) }
49
- all_podfile_specs.uniq!
50
-
51
- return all_podfile_specs.map { |spec| PodfileItem.new(spec, all_specs, checkout_options) }
64
+ updated_names = []
65
+ names.each do |name|
66
+ if pod = all_podfile_items.detect { |t| t.name == name }
67
+ podfile_pods.push(pod)
68
+ updated_names += pod.dependency_names
69
+ end
70
+ end
71
+
72
+ names = updated_names.uniq
73
+ podfile_pods.uniq!
74
+ end
75
+
76
+ return podfile_pods.sort_by(&:name)
52
77
  end
53
78
  end
54
79
  end
@@ -0,0 +1,16 @@
1
+ require 'cocoapods/installer/analyzer.rb'
2
+
3
+ module Pod
4
+ class Installer
5
+ class Analyzer
6
+ def explicit_pods
7
+ pods = []
8
+ podfile.root_target_definitions[0].children.each do |children|
9
+ pods += children.dependencies
10
+ end
11
+
12
+ pods.flatten.uniq.sort
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,7 +3,7 @@ require 'pod_builder/core'
3
3
  module PodBuilder
4
4
  module Command
5
5
  class Build
6
- def self.call(options)
6
+ def self.call(options)
7
7
  Configuration.check_inited
8
8
  PodBuilder::prepare_basepath
9
9
 
@@ -18,6 +18,8 @@ module PodBuilder
18
18
  Podfile.sanity_check()
19
19
  check_not_building_subspecs(argument_pods)
20
20
 
21
+ puts "Loading Podfile".yellow
22
+
21
23
  install_update_repo = options.fetch(:update_repos, true)
22
24
  installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
23
25
 
@@ -25,8 +27,11 @@ module PodBuilder
25
27
  prebuilt_items = all_buildable_items.select { |x| x.is_prebuilt }
26
28
  buildable_items = all_buildable_items - prebuilt_items
27
29
 
28
- if argument_pods.first == "*"
29
- argument_pods = buildable_items.map(&:root_name)
30
+ build_all = argument_pods.first == "*"
31
+ if build_all
32
+ argument_pods = analyzer.explicit_pods().map(&:root_name).uniq
33
+ else
34
+ argument_pods = Podfile::resolve_pod_names(argument_pods, all_buildable_items)
30
35
  end
31
36
 
32
37
  available_argument_pods = argument_pods.select { |x| all_buildable_items.map(&:root_name).include?(x) }
@@ -73,8 +78,10 @@ module PodBuilder
73
78
  licenses = []
74
79
 
75
80
  podfiles_items.select { |x| x.count > 0 }.each do |podfile_items|
76
- podfile_items = add_dependencies(podfile_items, all_buildable_items)
77
- podfile_content = Podfile.from_podfile_items(podfile_items, analyzer)
81
+ build_configuration = podfile_items.map(&:build_configuration).uniq.first
82
+
83
+ podfile_items = podfile_items.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
84
+ podfile_content = Podfile.from_podfile_items(podfile_items, analyzer, build_configuration)
78
85
 
79
86
  Install.podfile(podfile_content, podfile_items, podfile_items.first.build_configuration)
80
87
 
@@ -92,7 +99,10 @@ module PodBuilder
92
99
  Podspec::generate(all_buildable_items, analyzer)
93
100
 
94
101
  builded_pods = podfiles_items.flatten
95
- builded_pods_and_deps = add_dependencies(builded_pods, all_buildable_items).select { |x| !x.is_prebuilt }
102
+
103
+ builded_pods_and_deps = podfiles_items.flatten.map { |t| t.recursive_dependencies(all_buildable_items) }.flatten.uniq
104
+ builded_pods_and_deps.select! { |x| !x.is_prebuilt }
105
+
96
106
  Podfile::write_restorable(builded_pods_and_deps + prebuilt_pods_to_install, all_buildable_items, analyzer)
97
107
  if !options.has_key?(:skip_prebuild_update)
98
108
  Podfile::write_prebuilt(all_buildable_items, analyzer)
@@ -126,73 +136,74 @@ module PodBuilder
126
136
  return []
127
137
  end
128
138
 
129
- def self.add_dependencies(pods, buildable_items)
130
- pods.dup.each do |pod|
131
- build_configuration = pods.first.build_configuration
132
-
133
- dependencies = pod.dependencies(buildable_items).select { |x| !pods.include?(x) && !pod.has_common_spec(x.name) }
134
- dependencies.each { |x| x.build_configuration = build_configuration }
135
- pods = dependencies + pods # dependencies should come first
136
- end
137
-
138
- return pods
139
- end
140
-
141
- def self.expected_common_dependencies(pods_to_build, buildable_items, options)
142
- warned_expected_pod_list = []
143
- expected_pod_list = []
144
- errors = []
145
-
146
- pods_to_build.each do |pod_to_build|
147
- pod_to_build.dependency_names.each do |dependency|
148
- unless buildable_items.detect { |x| x.root_name == dependency || x.name == dependency } != nil
149
- next
150
- end
151
-
152
- buildable_items.each do |buildable_pod|
153
- unless !pod_to_build.dependency_names.include?(buildable_pod.name)
154
- next
155
- end
156
-
157
- if buildable_pod.dependency_names.include?(dependency) && !buildable_pod.has_subspec(dependency) && !buildable_pod.has_common_spec(dependency) then
158
- expected_pod_list += pods_to_build.map(&:root_name) + [buildable_pod.root_name]
159
- expected_pod_list.uniq!
160
-
161
- expected_list = expected_pod_list.join(" ")
162
- if !warned_expected_pod_list.include?(expected_list)
163
- errors.push("Can't build #{pod_to_build.name} because it has common dependencies (#{dependency}) with #{buildable_pod.name}.\n\nUse `pod_builder build #{expected_list}` instead or use `pod_builder build -a #{pod_to_build.name}` to automatically resolve missing dependencies\n\n")
164
- errors.uniq!
165
- warned_expected_pod_list.push(expected_list)
166
-
167
- if options.has_key?(:auto_resolve_dependencies)
168
- puts "`#{pod_to_build.name}` has the following dependencies:\n`#{pod_to_build.dependency_names.join("`, `")}`\nWhich are in common with `#{buildable_pod.name}` and requires it to be recompiled\n\n".yellow
169
- end
170
- end
171
- end
172
- end
173
- end
174
- end
175
-
176
- return expected_pod_list, errors
177
- end
178
-
179
- def self.expected_parent_dependencies(pods_to_build, buildable_items, options)
180
- expected_pod_list = []
181
- errors = []
182
-
183
- buildable_items_dependencies = buildable_items.map(&:dependency_names).flatten.uniq
184
- pods_to_build.each do |pod_to_build|
185
- if buildable_items_dependencies.include?(pod_to_build.name)
186
- parent = buildable_items.detect { |x| x.dependency_names.include?(pod_to_build.name) }
187
-
188
- expected_pod_list += (pods_to_build + [parent]).map(&:root_name)
189
- expected_pod_list.uniq!
190
- errors.push("Can't build #{pod_to_build.name} because it is a dependency of #{parent.name}.\n\nUse `pod_builder build #{expected_pod_list.join(" ")}` instead\n\n")
191
- end
192
- end
193
-
194
- return expected_pod_list, errors
195
- end
139
+ # def self.buildable_dependencies(pod, buildable_items)
140
+ # deps = []
141
+
142
+ # pod.dependency_names.each do |dependency|
143
+ # buildable_pods = buildable_items.select { |t| t.root_name == dependency }
144
+ # if buildable_pods.any? { |t| t.source_files.count > 0 }
145
+ # deps.push(dependency)
146
+ # end
147
+ # end
148
+
149
+ # return deps
150
+ # end
151
+
152
+ # def self.expected_common_dependencies(pods_to_build, buildable_items, options)
153
+ # warned_expected_pod_list = []
154
+ # expected_pod_list = []
155
+ # errors = []
156
+
157
+ # pods_to_build.each do |pod_to_build|
158
+ # buildable_dependencies(pod_to_build, buildable_items).each do |dependency|
159
+ # unless buildable_items.detect { |x| x.root_name == dependency || x.name == dependency } != nil
160
+ # next
161
+ # end
162
+
163
+ # buildable_items.each do |buildable_pod|
164
+ # unless !buildable_dependencies(pod_to_build, buildable_items).include?(buildable_pod.name)
165
+ # next
166
+ # end
167
+
168
+ # if buildable_dependencies(buildable_pod, buildable_items).include?(dependency) && !buildable_pod.has_subspec(dependency) && !buildable_pod.has_common_spec(dependency) then
169
+ # expected_pod_list += pods_to_build.map(&:root_name) + [buildable_pod.root_name]
170
+ # expected_pod_list.uniq!
171
+
172
+ # expected_list = expected_pod_list.join(" ")
173
+ # if !warned_expected_pod_list.include?(expected_list)
174
+ # errors.push("Can't build #{pod_to_build.name} because it has common dependencies (#{dependency}) with #{buildable_pod.name}.\n\nUse `pod_builder build #{expected_list}` instead or use `pod_builder build -a #{pod_to_build.name}` to automatically resolve missing dependencies\n\n")
175
+ # errors.uniq!
176
+ # warned_expected_pod_list.push(expected_list)
177
+
178
+ # if options.has_key?(:auto_resolve_dependencies)
179
+ # puts "`#{pod_to_build.name}` has the following dependencies:\n`#{buildable_dependencies(pod_to_build, buildable_items).join("`, `")}`\nWhich are in common with `#{buildable_pod.name}` and requires it to be recompiled\n\n".yellow
180
+ # end
181
+ # end
182
+ # end
183
+ # end
184
+ # end
185
+ # end
186
+
187
+ # return expected_pod_list, errors
188
+ # end
189
+
190
+ # def self.expected_parent_dependencies(pods_to_build, buildable_items, options)
191
+ # expected_pod_list = []
192
+ # errors = []
193
+
194
+ # buildable_items_dependencies = buildable_items.map(&:dependency_names).flatten.uniq
195
+ # pods_to_build.each do |pod_to_build|
196
+ # if buildable_items_dependencies.include?(pod_to_build.name)
197
+ # parent = buildable_items.detect { |x| x.dependency_names.include?(pod_to_build.name) }
198
+
199
+ # expected_pod_list += (pods_to_build + [parent]).map(&:root_name)
200
+ # expected_pod_list.uniq!
201
+ # errors.push("Can't build #{pod_to_build.name} because it is a dependency of #{parent.name}.\n\nUse `pod_builder build #{expected_pod_list.join(" ")}` instead\n\n")
202
+ # end
203
+ # end
204
+
205
+ # return expected_pod_list, errors
206
+ # end
196
207
 
197
208
  def self.check_not_building_subspecs(pods_to_build)
198
209
  pods_to_build.each do |pod_to_build|
@@ -278,27 +289,30 @@ module PodBuilder
278
289
  def self.resolve_pods_to_build(argument_pods, buildable_items, options)
279
290
  pods_to_build = []
280
291
 
281
- fns = [method(:expected_common_dependencies), method(:expected_parent_dependencies)]
282
- fns.each do |fn|
283
- loop do
284
- pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
285
- pods_to_build += other_subspecs(pods_to_build, buildable_items)
286
- tmp_buildable_items = buildable_items - pods_to_build
287
-
288
- expected_pods, errors = fn.call(pods_to_build, tmp_buildable_items, options)
289
- if expected_pods.count > 0
290
- if !options.has_key?(:auto_resolve_dependencies) && expected_pods.count > 0
291
- raise "\n\n#{errors.join("\n")}".red
292
- else
293
- argument_pods = expected_pods.uniq
294
- end
295
- end
292
+ # fns = [method(:expected_common_dependencies), method(:expected_parent_dependencies)]
293
+ # fns.each do |fn|
294
+ # loop do
295
+ # pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
296
+ # pods_to_build += other_subspecs(pods_to_build, buildable_items)
297
+ # tmp_buildable_items = buildable_items - pods_to_build
298
+
299
+ # expected_pods, errors = fn.call(pods_to_build, tmp_buildable_items, options)
300
+ # if expected_pods.count > 0
301
+ # if !options.has_key?(:auto_resolve_dependencies) && expected_pods.count > 0
302
+ # raise "\n\n#{errors.join("\n")}".red
303
+ # else
304
+ # argument_pods = expected_pods.uniq
305
+ # end
306
+ # end
296
307
 
297
- if !options.has_key?(:auto_resolve_dependencies) || expected_pods.count == 0
298
- break
299
- end
300
- end
301
- end
308
+ # if !options.has_key?(:auto_resolve_dependencies) || expected_pods.count == 0
309
+ # break
310
+ # end
311
+ # end
312
+ # end
313
+
314
+ pods_to_build = buildable_items.select { |x| argument_pods.include?(x.root_name) }
315
+ pods_to_build += other_subspecs(pods_to_build, buildable_items)
302
316
 
303
317
  return pods_to_build
304
318
  end
@@ -307,10 +321,10 @@ module PodBuilder
307
321
  puts "Cleaning framework folder".yellow
308
322
 
309
323
  expected_frameworks = buildable_items.map { |x| "#{x.module_name}.framework" }
310
- expected_frameworks += buildable_items.map { |x| x.vendored_items }.flatten.map { |x| File.basename(x) }
324
+ expected_frameworks += buildable_items.map { |x| x.vendored_frameworks }.flatten.map { |x| File.basename(x) }
311
325
  expected_frameworks.uniq!
312
326
 
313
- existing_frameworks = Dir.glob("#{PodBuilder::basepath("Rome")}/*.framework")
327
+ existing_frameworks = Dir.glob(PodBuilder::prebuiltpath("*.framework"))
314
328
 
315
329
  existing_frameworks.each do |existing_framework|
316
330
  existing_framework_name = File.basename(existing_framework)
@@ -320,7 +334,7 @@ module PodBuilder
320
334
  end
321
335
  end
322
336
 
323
- existing_dsyms = Dir.glob("#{PodBuilder::basepath("dSYM")}/**/*.dSYM")
337
+ existing_dsyms = Dir.glob(PodBuilder::dsympath("**/*.dSYM"))
324
338
  existing_dsyms.each do |existing_dsym|
325
339
  existing_dsym_name = File.basename(existing_dsym)
326
340
  if !expected_frameworks.include?(existing_dsym_name.gsub(".dSYM", ""))
@@ -13,24 +13,22 @@ module PodBuilder
13
13
  all_buildable_items = Analyze.podfile_items(installer, analyzer)
14
14
 
15
15
  podspec_names = all_buildable_items.map(&:podspec_name)
16
- rel_paths = all_buildable_items.map(&:prebuilt_rel_path)
16
+ rel_paths = all_buildable_items.map(&:prebuilt_rel_path) + all_buildable_items.map(&:vendored_frameworks).flatten.map { |t| File.basename(t) }
17
+ rel_paths.uniq!
17
18
 
18
- base_path = PodBuilder::basepath("Rome")
19
+ base_path = PodBuilder::prebuiltpath
19
20
  framework_files = Dir.glob("#{base_path}/**/*.framework")
20
21
  puts "Looking for unused frameworks".yellow
21
22
  clean(framework_files, base_path, rel_paths)
22
23
 
23
24
  rel_paths.map! { |x| "#{x}.dSYM"}
24
25
 
25
- base_path = PodBuilder::basepath("dSYM/iphoneos")
26
- dSYM_files_iphone = Dir.glob("#{base_path}/**/*.dSYM")
27
- puts "Looking for iPhoneOS unused dSYMs".yellow
28
- clean(dSYM_files_iphone, base_path, rel_paths)
29
-
30
- base_path = PodBuilder::basepath("dSYM/iphonesimulator")
31
- dSYM_files_sim = Dir.glob("#{base_path}/**/*.dSYM")
32
- puts "Looking for iPhone Simulator unused dSYMs".yellow
33
- clean(dSYM_files_sim, base_path, rel_paths)
26
+ Configuration.supported_platforms.each do |platform|
27
+ base_path = PodBuilder::dsympath(platform)
28
+ dSYM_files = Dir.glob("#{base_path}/**/*.dSYM")
29
+ puts "Looking for #{platform} unused dSYMs".yellow
30
+ clean(dSYM_files, base_path, rel_paths)
31
+ end
34
32
 
35
33
  puts "Looking for unused sources".yellow
36
34
  clean_sources(podspec_names)