Class: PodPrebuild::DependenciesGraphCacheValidator

Inherits:
AccumulatedCacheValidator show all
Defined in:
lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb

Instance Attribute Summary

Attributes inherited from BaseCacheValidator

#generated_framework_path, #pod_lockfile, #podfile, #prebuilt_lockfile, #validate_prebuilt_settings

Instance Method Summary collapse

Methods inherited from BaseCacheValidator

#changes_of_prebuilt_lockfile_vs_podfile, #incompatible_build_settings, #incompatible_pod, #load_metadata, #read_prebuilt_build_settings, #read_source_hash, #validate_pods, #validate_with_podfile

Constructor Details

#initialize(options) ⇒ DependenciesGraphCacheValidator

Returns a new instance of DependenciesGraphCacheValidator.



3
4
5
6
# File 'lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb', line 3

def initialize(options)
  super(options)
  @ignored_pods = options[:ignored_pods] || Set.new
end

Instance Method Details

#library_evolution_supported?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb', line 21

def library_evolution_supported?
  false
end

#validate(accumulated) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb', line 8

def validate(accumulated)
  return accumulated if library_evolution_supported? || @pod_lockfile.nil?

  dependencies_graph = DependenciesGraph.new(@pod_lockfile.lockfile)
  clients = dependencies_graph.get_clients(accumulated.discard(@ignored_pods).missed.to_a)
  unless PodPrebuild.config.dev_pods_enabled?
    clients = clients.reject { |client| @pod_lockfile.dev_pods.keys.include?(client) }
  end

  missed = clients.map { |client| [client, "Dependencies were missed"] }.to_h
  accumulated.merge(PodPrebuild::CacheValidationResult.new(missed, Set.new))
end