Sha256: b860fde0a626290776ab4ea17414b16f1334f0b885b342d5ce1c2d95ec5d1332

Contents?: true

Size: 755 Bytes

Versions: 3

Compression:

Stored size: 755 Bytes

Contents

module Symbols
  #
  # performs symbol aliasing
  #
  # for each dependency:
  # 	- determine symbols for classes and global constants
  # 	- alias each symbol to Pod#{pod_name}_#{symbol}
  # 	- put defines into `GCC_PREPROCESSOR_DEFINITIONS` for passing to Xcode
  #
  def mangle_for_pod_dependencies(pod_name, sandbox_root)
    pod_libs = Dir.glob("#{sandbox_root}/build/libPods-*.a").select do
      |file| file !~ /#{pod_name}/
    end

    all_syms = []

    pod_libs.each do |pod_lib|
      syms = Symbols.symbols_from_library(pod_lib)
      all_syms += syms.map! { |sym| sym + "=Pod#{pod_name}_" + sym }
    end

    "GCC_PREPROCESSOR_DEFINITIONS='${inherited} #{all_syms.uniq.join(' ')}'"
  end

  module_function :mangle_for_pod_dependencies
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cocoapods-packager-0.4.0 lib/mangle.rb
cocoapods-packager-0.3.0 lib/mangle.rb
cocoapods-packager-0.2.0 lib/mangle.rb