Sha256: 105aa5f66cf7c2f67bd85f4eff06c0e3c143f9e98795258d4f20ca7344562996

Contents?: true

Size: 956 Bytes

Versions: 69

Compression:

Stored size: 956 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/lib*.a").select do |file|
      file !~ /lib#{pod_name}.a$/
    end

    dummy_alias = alias_symbol "PodsDummy_#{pod_name}", pod_name
    all_syms = [dummy_alias]

    pod_libs.each do |pod_lib|
      syms = Symbols.symbols_from_library(pod_lib)
      all_syms += syms.map! { |sym| alias_symbol sym, pod_name }
    end

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

  def alias_symbol(sym, pod_name)
    pod_name = pod_name.tr('-', '_')
    sym + "=Pod#{pod_name}_" + sym
  end

  module_function :mangle_for_pod_dependencies, :alias_symbol
end

Version data entries

69 entries across 69 versions & 21 rubygems

Version Path
cocoapods-packager-next-2.0.1 lib/cocoapods-packager/mangle.rb
cocoapods-packager-next-2.0.0 lib/cocoapods-packager/mangle.rb
cocoapods-packagerthk-1.0.4 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packagerthk-1.0.3 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packagerthk-1.0.2 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packagerthk-1.0.1 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packagerthk-1.0.0 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packagerthk-0.0.1 lib/cocoapods-packagerthk/mangle.rb
cocoapods-packager-tj-1.5.0 lib/cocoapods-packager/mangle.rb
cocoapods-packager-test-scl-1.6.2 lib/cocoapods-packager/mangle.rb
cocoapods-packager-test-scl-1.6.1 lib/cocoapods-packager/mangle.rb
cocoapods-packager-test-scl-1.6.0 lib/cocoapods-packager/mangle.rb
cocoapods-packager-test-scl-1.5.0 lib/cocoapods-packager/mangle.rb
cocoapods-packager-clone-master-1.5.2 lib/cocoapods-packager/mangle.rb
cocoapods-panglePackager-1.5.0.2 lib/cocoapods-panglePackager/mangle.rb
cocoapods-panglePackager-1.5.0.1 lib/cocoapods-panglePackager/mangle.rb
cocoapods-fanQiePackager-1.5.0.1 lib/cocoapods-fanQiePackager/mangle.rb
cocoapods-nepackage-0.0.2 lib/cocoapods-nepackager/mangle.rb
cocoapods-gd-0.0.3 lib/cocoapods-gd/mangle.rb
cocoapods-gd-0.0.2 lib/cocoapods-gd/mangle.rb