Sha256: 2f0989c58b343dff46a91e45eaa4aeab73e0a1b9b982e929bdf410e5a5dcb06c

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

module PodPrebuild
  class DependenciesGraphCacheValidator < AccumulatedCacheValidator
    def initialize(options)
      super(options)
      @ignored_pods = options[:ignored_pods] || Set.new
    end

    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 Pod::Podfile::DSL.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

    def library_evolution_supported?
      false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-binary-cache-0.1.6 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb