Skip to content

Commit ab91434

Browse files
committed
fix #50
1 parent 0cfa27a commit ab91434

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/cocoapods-binary/Prebuild.rb

+14-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,20 @@ def prebuild_frameworks!
126126
if target.static_framework? and !target.resource_paths.empty?
127127
framework_path = output_path + target.framework_name
128128
standard_sandbox_path = sandbox.standard_sanbox_path
129-
path_objects = target.resource_paths.map do |path|
129+
130+
resources = begin
131+
if Pod::VERSION.start_with? "1.5"
132+
target.resource_paths
133+
else
134+
# resource_paths is Hash{String=>Array<String>} on 1.6 and above
135+
# (use AFNetworking to generate a demo data)
136+
# https://github.com/leavez/cocoapods-binary/issues/50
137+
target.resource_paths.values.flatten
138+
end
139+
end
140+
raise "Wrong type: #{resources}" unless resources.kind_of? Array
141+
142+
path_objects = resources.map do |path|
130143
object = Prebuild::Passer::ResourcePath.new
131144
object.real_file_path = framework_path + File.basename(path)
132145
object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'

0 commit comments

Comments
 (0)