Sha256: 208aac23e3dd3f38747c0befd48906d2fbd39b9652885490225627f4ae36c5ae

Contents?: true

Size: 1.85 KB

Versions: 54

Compression:

Stored size: 1.85 KB

Contents

# ABOUT NAMES
#
# There are many kinds of name in cocoapods. Two main names are widely used in this plugin.
# - root_spec.name (spec.root_name, targe.pod_name):
#   aka "pod_name"
#   the name we use in podfile. the concept.
# 
# - target.name:
#   aka "target_name"
#   the name of the final target in xcode project. the final real thing.
#
# One pod may have multiple targets in xcode project, due to one pod can be used in mutiple 
# platform simultaneously. So one `root_spec.name` may have multiple coresponding `target.name`s.
# Therefore, map a spec to/from targets is a little complecated. It's one to many.
#

# Tool to transform Pod_name to target efficiently
module Pod
    def self.fast_get_targets_for_pod_name(pod_name, targets, cache)
        pod_name_to_targets_hash = nil
        if cache.empty?
            pod_name_to_targets_hash = targets.reduce({}) do |sum, target|
                array = sum[target.pod_name] || []
                array << target
                sum[target.pod_name] = array
                sum
            end
            cache << pod_name_to_targets_hash
        else
            pod_name_to_targets_hash = cache.first
        end
        
        pod_name_to_targets_hash[pod_name] || []
    end
end






# Target:
   
#     def pod_name
#       root_spec.name
#     end

#     def name
# 	    pod_name + #{scope_suffix}
#     end	

#     def product_module_name
#       root_spec.module_name
#     end
  
#     def framework_name
#       "#{product_module_name}.framework"
#     end

#    def product_name
#       if requires_frameworks?
#         framework_name
#       else
#         static_library_name
#       end
#     end

#     def product_basename
#       if requires_frameworks?
#         product_module_name
#       else
#         label
#       end
#     end

#     def framework_name
#       "#{product_module_name}.framework"
#     end

Version data entries

54 entries across 54 versions & 11 rubygems

Version Path
cocoapods-jxedt-0.0.21 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.20 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.19 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.18 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.17 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.16 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.15 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.14 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.13 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.12 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.10 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-jxedt-0.0.9 lib/cocoapods-jxedt/binary/helper/names.rb
cocoapods-ppbuild-1.0.9 lib/cocoapods-ppbuild/helper/names.rb
cocoapods-util-0.2.1 lib/cocoapods-util/binary/helper/names.rb
cocoapods-util-0.2.0 lib/cocoapods-util/binary/helper/names.rb
cocoapods-zjbinary-1.0.0 lib/cocoapods-zjbinary/helper/names.rb
cocoapods-binary-bugfix-0.0.3 lib/cocoapods-binary-bugfix/helper/names.rb
cocoapods-binary-bugfix-0.0.2 lib/cocoapods-binary-bugfix/helper/names.rb
cocoapods-binary-bugfix-0.0.1 lib/cocoapods-binary-bugfix/helper/names.rb
cocoapods-xlbuild-1.1.2 lib/cocoapods-xlbuild/helper/names.rb