class PodAlexandria::UserOptions

Attributes

environment_configs[R]
force_bitcode[R]
xcodegen_dependencies_file[R]

Public Class Methods

new(installer_context, user_options) click to toggle source
# File lib/cocoapods-alexandria/helper/user_options.rb, line 7
def initialize(installer_context, user_options)
  @environment_configs = user_options.fetch('environment_configs', default_configurations(installer_context))
  @force_bitcode = user_options.fetch('force_bitcode', true)
  @xcodegen_dependencies_file = user_options.fetch('xcodegen_dependencies_file', 'projectDependencies.yml')
end

Public Instance Methods

environment_configs_for(target) click to toggle source
# File lib/cocoapods-alexandria/helper/user_options.rb, line 13
def environment_configs_for(target)
  environment_configs[normalize_target(target)]
end

Private Instance Methods

default_configurations(installer_context) click to toggle source
# File lib/cocoapods-alexandria/helper/user_options.rb, line 19
def default_configurations(installer_context)
  if installer_context.respond_to? :umbrella_targets
    installer_context.umbrella_targets.map { |target|
      target_name = normalize_target(target.cocoapods_target_label)
      configs = installer_context.pods_project.configurations
        .map { |config| [config, "Supporting Files/Settings-#{config.gsub('-', ' ').split[0]}.xcconfig"] }
        .to_h
      [target_name, configs]
    }.to_h
  else
    {}
  end
end
normalize_target(target) click to toggle source
# File lib/cocoapods-alexandria/helper/user_options.rb, line 33
def normalize_target(target)
  target.sub(/^Pods-/, '')
end