Class: XcodeArchiveCache::Injection::HeadersMover

Inherits:
Object
  • Object
show all
Includes:
Logs
Defined in:
lib/injection/headers_mover.rb

Instance Method Summary collapse

Methods included from Logs

#debug, #error, #info, #set_log_level

Constructor Details

#initialize(storage) ⇒ HeadersMover

Returns a new instance of HeadersMover.

Parameters:



9
10
11
12
# File 'lib/injection/headers_mover.rb', line 9

def initialize(storage)
  @storage = storage
  @build_settings_interpolator = XcodeArchiveCache::BuildSettings::StringInterpolator.new
end

Instance Method Details

#prepare_headers_for_injection(node) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/injection/headers_mover.rb', line 16

def prepare_headers_for_injection(node)
  debug("checking #{node.name} headers")
  header_count = 0

  node.native_target.copy_files_build_phases.each do |build_phase|
    file_paths = build_phase.files
                     .map {|build_file| get_real_path(build_file)}
                     .compact
                     .uniq
                     .select {|path| File.extname(path) == ".h"}
    destination_path = get_destination_dir_path(node, build_phase)
    storage.store_headers(node, destination_path, file_paths)

    header_count += file_paths.length
  end

  debug("found #{header_count} headers")
end