class Pod::Generator::XCConfig::PrivatePodXCConfig


configuration values required by CocoaPods.
values of the public namespaced xcconfig with the default private
The private xcconfig file for a Pod target merges the configuration
Generates the private xcconfigs for the pod targets.

def add_xcconfig_namespaced_keys(source_config, destination_config, prefix)

Returns:
  • (Hash) - The inheriting xcconfig.

Parameters:
  • destination_config (Hash) --
  • source_config (Hash) --
def add_xcconfig_namespaced_keys(source_config, destination_config, prefix)
  result = destination_config.dup
  source_config.each do |key, value|
    prefixed_key = prefix + conditional_less_key(key)
    current_value = destination_config[key]
    if current_value
      result[key] = "#{current_value} ${#{prefixed_key}}"
    else
      result[key] = "${#{prefixed_key}}"
    end
  end
  result
end

def conditional_less_key(key)

Returns:
  • (String) - The stripped key.

Parameters:
  • key (String) --
def conditional_less_key(key)
  brackets_index = key.index('[')
  if brackets_index
    key[0...brackets_index]
  else
    key
  end
end

def generate

Returns:
  • (Xcodeproj::Config) -
def generate
  search_pahts = target.build_headers.search_paths.concat(target.sandbox.public_headers.search_paths)
  config = {
    'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
    'PODS_ROOT'  => '${SRCROOT}',
    'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_pahts),
    'GCC_PREPROCESSOR_DEFINITIONS' => 'COCOAPODS=1',
    # 'USE_HEADERMAP' => 'NO'
  }
  xcconfig_hash = add_xcconfig_namespaced_keys(public_xcconfig.to_hash, config, target.xcconfig_prefix)
  @xcconfig = Xcodeproj::Config.new(xcconfig_hash)
  @xcconfig.includes = [target.name]
  @xcconfig
end

def initialize(target, public_xcconfig)

Parameters:
  • public_xcconfig (Xcodeproj::Config) -- @see public_xcconfig
  • target (Target) -- @see target
def initialize(target, public_xcconfig)
  @target = target
  @public_xcconfig = public_xcconfig
end

def save_as(path)

Returns:
  • (void) -

Parameters:
  • path (Pathname) --
def save_as(path)
  generate.save_as(path)
end