class PodAlexandria::LocalPostInstallHook

Attributes

options[R]
pods_project[R]
sandbox_root[R]
umbrella_targets[R]

Public Class Methods

new(installer_context, user_options) click to toggle source
# File lib/cocoapods-alexandria/env_local/post_install.rb, line 5
def initialize(installer_context, user_options)
  @pods_project = installer_context.pods_project
  @sandbox_root = installer_context.sandbox_root
  @umbrella_targets = installer_context.umbrella_targets
  @options = UserOptions.new(installer_context, user_options)
end

Public Instance Methods

run() click to toggle source
# File lib/cocoapods-alexandria/env_local/post_install.rb, line 12
def run
  Pod::UI.title "Tweaking CocoaPods for XcodeGen..."
  pods_project.fix_deployment_target_warnings
  include_user_configs_in_pods_xcconfigs
end

Private Instance Methods

append_include_to_config(target, config, include) click to toggle source
# File lib/cocoapods-alexandria/env_local/post_install.rb, line 29
def append_include_to_config(target, config, include)
  xcconfig = "#{sandbox_root}/Target Support Files/#{target.cocoapods_target_label}/#{target.cocoapods_target_label}.#{config.downcase}.xcconfig"
  
  File.open(xcconfig, 'a') do |f|
    f.puts ''
    f.puts "#include \"../../../#{include}\""
  end
end
include_user_configs_in_pods_xcconfigs() click to toggle source
# File lib/cocoapods-alexandria/env_local/post_install.rb, line 20
def include_user_configs_in_pods_xcconfigs
  umbrella_targets.each do |target|
    pods_project.configurations.each do |config|
      config_path = options.environment_configs_for(target.cocoapods_target_label)[config]
      append_include_to_config(target, config, config_path)
    end
  end
end