Commit eefb1d21 authored by Diego Torres's avatar Diego Torres

Separated resources_by_config into it’s own method to ease testability

parent 6b0f9bb1
...@@ -102,16 +102,11 @@ module Pod ...@@ -102,16 +102,11 @@ module Pod
end end
end end
# Creates a script that copies the resources to the bundle of the client # Uniqued Resources grouped by config
# target.
# #
# @note The bridge support file needs to be created before the prefix # @return [Hash{ Symbol => Array<Pathname> }]
# header, otherwise it will not be added to the resources script.
# #
# @return [void] def resources_by_config
#
def create_copy_resources_script
path = target.copy_resources_script_path
library_targets = target.pod_targets.reject do |pod_target| library_targets = target.pod_targets.reject do |pod_target|
pod_target.should_build? && pod_target.requires_frameworks? pod_target.should_build? && pod_target.requires_frameworks?
end end
...@@ -123,6 +118,18 @@ module Pod ...@@ -123,6 +118,18 @@ module Pod
resources_by_config[config] = (resource_paths + resource_bundles).uniq resources_by_config[config] = (resource_paths + resource_bundles).uniq
resources_by_config[config] << bridge_support_file if bridge_support_file resources_by_config[config] << bridge_support_file if bridge_support_file
end end
resources_by_config
end
# Creates a script that copies the resources to the bundle of the client
# target.
#
# @note The bridge support file needs to be created before the prefix
# header, otherwise it will not be added to the resources script.
#
# @return [void]
#
def create_copy_resources_script
generator = Generator::CopyResourcesScript.new(resources_by_config, target.platform) generator = Generator::CopyResourcesScript.new(resources_by_config, target.platform)
generator.save_as(path) generator.save_as(path)
add_file_to_support_group(path) add_file_to_support_group(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment