Sha256: 501337d302f37943bde46ccc2f4214fb985048913ca27e62d7459efca06574e2

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

require 'cocoapods'
require 'cocoapods-core'

module Pod 
    class Podfile
        class TargetDefinition

            # linklines is a array to save data if you directy define :linkage => static or :linkage => dynimic
            def ll_expedition_linkages(name, requirements,key)
                linklines ||= {}
                options = requirements.last || {}
                linklines[Specification.root_name(name)] = options[key] if options.is_a?(Hash) && options[key]
                options.delete(key) if options.is_a?(Hash)
                requirements.pop if options.empty?
                linklines
            end

            def ll_linkages(is_linkage_all)
                pod_linkage = (is_linkage_all == true ? @linkages : @linkage) || {}
                pod_linkage.merge!(parent.ll_linkages(is_linkage_all)) { |key, v1, v2| v1 } if !parent.nil? && parent.is_a?(TargetDefinition)
                pod_linkage
            end

            ll_original_parse_inhibit_warnings = instance_method(:parse_inhibit_warnings)
            define_method(:parse_inhibit_warnings) do |name, requirements|
                if requirements.last.has_key?(:path)
                    $ll_has_local_path = true 
                end
                @linkage ||= {}
                @linkages ||= {}
                @linkage = @linkage.merge(ll_expedition_linkages(name, requirements,:linkage))
                @linkages = @linkages.merge(ll_expedition_linkages(name, requirements,:linkages))
                ll_original_parse_inhibit_warnings.bind(self).call(name, requirements)
            end
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-linkline-0.2.0 lib/cocoapods-linkline/command/targetdefinition-linkline.rb