Skip to content

Commit 8ef3d11

Browse files
committed
fix leavez#50
1 parent 9f40c5d commit 8ef3d11

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/cocoapods-binary/Prebuild.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,20 @@ def prebuild_frameworks!
121121
if target.static_framework? and !target.resource_paths.empty?
122122
framework_path = output_path + target.framework_name
123123
standard_sandbox_path = sandbox.standard_sanbox_path
124-
path_objects = target.resource_paths.map do |path|
124+
125+
resources = begin
126+
if Pod::VERSION.start_with? "1.5"
127+
target.resource_paths
128+
else
129+
# resource_paths is Hash{String=>Array<String>} on 1.6 and above
130+
# (use AFNetworking to generate a demo data)
131+
# https://github.com/leavez/cocoapods-binary/issues/50
132+
target.resource_paths.values.flatten
133+
end
134+
end
135+
raise "Wrong type: #{resources}" unless resources.kind_of? Array
136+
137+
path_objects = resources.map do |path|
125138
object = Prebuild::Passer::ResourcePath.new
126139
object.real_file_path = framework_path + File.basename(path)
127140
object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'

0 commit comments

Comments
 (0)