Class: Pod::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-jxedt/binary/Intergation.rb,
lib/cocoapods-jxedt/binary/Intergation.rb,
lib/cocoapods-jxedt/binary/helper/podfile_options.rb

Defined Under Namespace

Classes: PodSourceInstaller

Instance Method Summary collapse

Instance Method Details

#create_pod_installer(pod_name) ⇒ Object



220
221
222
223
224
225
226
227
228
# File 'lib/cocoapods-jxedt/binary/Intergation.rb', line 220

def create_pod_installer(pod_name)
    pod_installer = old_create_pod_installer(pod_name)

    pods_to_install = sandbox_state.added | sandbox_state.changed
    unless pods_to_install.include?(pod_name)
        pod_installer.install_for_prebuild!(self.sandbox) if self.prebuild_pod_names.include? pod_name
    end
    pod_installer
end

#old_create_pod_installerObject



219
# File 'lib/cocoapods-jxedt/binary/Intergation.rb', line 219

alias_method :old_create_pod_installer, :create_pod_installer

#prebuild_pod_namesObject

Returns the names of pod targets detected as prebuilt, including those declared in Podfile and their dependencies



38
39
40
# File 'lib/cocoapods-jxedt/binary/helper/podfile_options.rb', line 38

def prebuild_pod_names
  prebuilt_pod_targets.map(&:name).to_set
end

#prebuilt_pod_targetsObject

Returns the pod targets detected as prebuilt, including those declared in Podfile and their dependencies



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/cocoapods-jxedt/binary/helper/podfile_options.rb', line 44

def prebuilt_pod_targets
  @prebuilt_pod_targets ||= begin
    explicit_prebuild_pod_names = aggregate_targets.flat_map { |target| 
      target.target_definition.explicit_prebuild_pod_names
    }.uniq

    reject_prebuild_pod_names = aggregate_targets.flat_map { |target| 
      target.target_definition.reject_prebuild_pod_names 
    }.uniq
    
    available_pod_names = []
    check_sandbox = Jxedt::Sandbox.from_sandbox(self.sandbox)
    available_pod_names = check_sandbox.target_paths.map {|path| path.basename.to_s }
    if Jxedt.config.all_binary_enabled?
      explicit_prebuild_pod_names = available_pod_names
    else
      explicit_prebuild_pod_names = (explicit_prebuild_pod_names & available_pod_names).uniq
    end
    explicit_prebuild_pod_names -= reject_prebuild_pod_names
    
    targets = pod_targets.select { |target| 
      explicit_prebuild_pod_names.include?(target.pod_name)
    }
    targets = targets.reject { |target| sandbox.local?(target.pod_name) } unless Jxedt.config.dev_pods_enabled?
    targets.reject! { |target| Jxedt.config.excluded_pods.include?(target.pod_name) }
    targets.map { |target| target.use_binary = true }
    targets
  end
end