Class: PodPrebuild::PreInstallHook

Inherits:
Object
  • Object
show all
Includes:
ObjectSpace
Defined in:
lib/cocoapods-binary-cache/hooks/pre_install.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(installer_context) ⇒ PreInstallHook

Returns a new instance of PreInstallHook.



7
8
9
10
11
12
13
14
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 7

def initialize(installer_context)
  @installer_context = installer_context
  @podfile = installer_context.podfile
  @pod_install_options = {}
  @prebuild_sandbox = nil
  @standard_sandbox = installer_context.sandbox
  @cache_validation = nil
end

Instance Attribute Details

#cache_validationObject (readonly)

Returns the value of attribute cache_validation.



5
6
7
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 5

def cache_validation
  @cache_validation
end

#installer_contextObject (readonly)

Returns the value of attribute installer_context.



5
6
7
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 5

def installer_context
  @installer_context
end

#podfileObject (readonly)

Returns the value of attribute podfile.



5
6
7
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 5

def podfile
  @podfile
end

#prebuild_sandboxObject (readonly)

Returns the value of attribute prebuild_sandbox.



5
6
7
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 5

def prebuild_sandbox
  @prebuild_sandbox
end

#standard_sandboxObject (readonly)

Returns the value of attribute standard_sandbox.



5
6
7
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 5

def standard_sandbox
  @standard_sandbox
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cocoapods-binary-cache/hooks/pre_install.rb', line 16

def run
  return if @installer_context.sandbox.is_a?(Pod::PrebuildSandbox)

  log_section "🚀  Prebuild frameworks"
  ensure_valid_podfile
  save_installation_states
  create_prebuild_sandbox
  Pod::UI.title("Detect implicit dependencies") { detect_implicit_dependencies }
  Pod::UI.title("Validate prebuilt cache") { validate_cache }
  prebuild! if PodPrebuild.config.prebuild_job?

  PodPrebuild::Env.next_stage!
  prepare_for_integration
  log_section "🤖  Resume pod installation"
  require_relative "../pod-binary/integration"
end