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



7
8
9
10
11
12
13
# 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
  @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

Instance Method Details

#runObject



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

def run
  require_relative "../pod-binary/helper/feature_switches"
  return if Pod.is_prebuild_stage

  log_section "🚀  Prebuild frameworks"
  ensure_valid_podfile
  save_installation_states
  prepare_environment
  create_prebuild_sandbox
  Pod::UI.section("Detect implicit dependencies") { detect_implicit_dependencies }
  Pod::UI.section("Validate prebuilt cache") { validate_cache }
  prebuild! if Pod::Podfile::DSL.prebuild_job?
  reset_environment
  log_section "🤖  Resume pod installation"
  require_relative "../pod-binary/integration"
end