Method: Pod::Installer::ProjectCache::TargetCacheKey.from_cache_hash

Defined in:
lib/cocoapods/installer/project_cache/target_cache_key.rb

.from_cache_hash(sandbox, key_hash) ⇒ TargetCacheKey

Creates a TargetCacheKey instance from the given hash.

Parameters:

  • sandbox (Sandbox)

    The sandbox to use to construct a TargetCacheKey object.

  • key_hash (Hash{String => Object})

    The hash used to construct a TargetCacheKey object.

Returns:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/cocoapods/installer/project_cache/target_cache_key.rb', line 97

def self.from_cache_hash(sandbox, key_hash)
  cache_hash = key_hash.dup
  if files = cache_hash['FILES']
    cache_hash['FILES'] = files.sort_by(&:downcase)
  end
  if specs = cache_hash['SPECS']
    cache_hash['SPECS'] = specs.sort_by(&:downcase)
  end
  if resources = cache_hash['RESOURCES']
    cache_hash['RESOURCES'] = resources.sort_by(&:downcase)
  end
  type = cache_hash['CHECKSUM'] ? :pod_target : :aggregate
  TargetCacheKey.new(sandbox, type, cache_hash)
end