Class: PodBuilder::Command::InstallSources

Inherits:
Object
  • Object
show all
Defined in:
lib/pod_builder/command/install_sources.rb

Class Method Summary collapse

Class Method Details

.call(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pod_builder/command/install_sources.rb', line 6

def self.call(options)
  Configuration.check_inited
  PodBuilder::prepare_basepath

  install_update_repo = options.fetch(:update_repos, true)
  installer, analyzer = Analyze.installer_at(PodBuilder::basepath, install_update_repo)
  framework_items = Analyze.podfile_items(installer, analyzer).select { |x| !x.is_prebuilt }
  podspec_names = framework_items.map(&:podspec_name)

  base_path = PodBuilder::basepath("Rome")
  framework_files = Dir.glob("#{base_path}/**/*.framework")
  
  framework_files.each do |path|
    rel_path = Pathname.new(path).relative_path_from(Pathname.new(base_path)).to_s

    if framework_spec = framework_items.detect { |x| x.prebuilt_rel_path == rel_path }
      update_repo(framework_spec)
    end
  end

  Command::Clean::clean_sources()

  rewrite_lldinit

  puts "\n\nšŸŽ‰ done!\n".green
  return 0
end