Sha256: 2374a2f8b61b775ab8a245e651e41b27b1b4ab80b7a87d34c00e53fbae455c00

Contents?: true

Size: 870 Bytes

Versions: 7

Compression:

Stored size: 870 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 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

    def library_evolution_supported?
      false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cocoapods-binary-cache-0.1.13 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.12 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.11 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.10 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.9 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.8 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb
cocoapods-binary-cache-0.1.7 lib/cocoapods-binary-cache/cache/validator_dependencies_graph.rb