Class: Pod::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-cache-proxy/native/resolver.rb

Instance Method Summary collapse

Instance Method Details

#orig_resolver_specs_by_targetObject



9
# File 'lib/cocoapods-cache-proxy/native/resolver.rb', line 9

alias_method :orig_resolver_specs_by_target, :resolver_specs_by_target

#resolver_specs_by_targetObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/cocoapods-cache-proxy/native/resolver.rb', line 10

def resolver_specs_by_target()
    specs_by_target = orig_resolver_specs_by_target()
    proxy_source = Pod::Config.instance.cache_proxy_source
    return specs_by_target if proxy_source.nil?

    show_output = Pod::Config.instance.verbose?
    specs_by_target.each do |target, rspecs|
        rspecs.each do |spec|
            root_spec = spec.spec.root
            source = root_spec.source
            UI.message "spec name: #{root_spec.name}" if show_output
            UI.message "spec source: #{source}" if show_output
            UI.message "spec version: #{root_spec.version}" if show_output
            next unless !source.blank? && source.has_key?(:git) && source.has_key?(:tag)
            UI.message "ignore_cache_proxy_pod: #{target.name} #{root_spec.name}" if show_output; next if target.check_ignore_cache_proxy_pod(root_spec.name)
                
            git = source[:git]
            tag = source[:tag]
            submodules = source.has_key?(:submodules) ? source[:submodules] : false
            new_url = proxy_source.build_proxy_source(root_spec.name, git, tag, submodules)
            source = {
                :http => new_url,
                :type => "tgz",
            }
            UI.message "spec new source: #{source}" if show_output
            root_spec.source = source
        end
    end
    specs_by_target
end