def self.from_dependency(dependency, podfile_path, can_cache)
from_params(dependency.external_source, dependency, podfile_path, can_cache)
end
def self.from_params(params, dependency, podfile_path, can_cache)
name = dependency.root_name
if klass = concrete_class_from_params(params)
klass.new(name, params, podfile_path, can_cache)
else
msg = "Unknown external source parameters for `#{name}`: `#{params}`"
raise Informative, msg
end
end
# Get the class to represent the defined source type of a dependency
#
# @param [Array<Symbol>] params
# the source params of the dependency
#
# @return [Class]
#
def self.concrete_class_from_params(params)
if params.key?(:podspec)
PodspecSource
elsif params.key?(:path)
PathSource
elsif Downloader.strategy_from_options(params)
DownloaderSource
end
end
这段代码位于code.rb中,但是fetch_external_source是不是用错了,pod bin code [podname]这个里面的podname应该是在二进制源内的吧,那他的find_dependency.external_source就会是nil,然后在cocoapods代码里面会报nil没有key?这个方法。
感觉改成下面这样会不会好点,求大佬解答一下,我这跑半天都是报错的
下载源码到本地
这段代码位于code.rb中,但是fetch_external_source是不是用错了,pod bin code [podname]这个里面的podname应该是在二进制源内的吧,那他的find_dependency.external_source就会是nil,然后在cocoapods代码里面会报nil没有key?这个方法。 感觉改成下面这样会不会好点,求大佬解答一下,我这跑半天都是报错的