Cache result of resource and framework paths

parent c6eee2ed
...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Cache result of resource and framework paths
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6893](https://github.com/CocoaPods/CocoaPods/pull/6893)
* Ensure source urls are set when spec has subspecs with dependencies * Ensure source urls are set when spec has subspecs with dependencies
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6888](https://github.com/CocoaPods/CocoaPods/pull/6888) [#6888](https://github.com/CocoaPods/CocoaPods/pull/6888)
......
...@@ -188,26 +188,30 @@ module Pod ...@@ -188,26 +188,30 @@ module Pod
# input and output paths grouped by config # input and output paths grouped by config
# #
def framework_paths_by_config def framework_paths_by_config
framework_paths_by_config = {} @framework_paths_by_config ||= begin
user_build_configurations.keys.each do |config| framework_paths_by_config = {}
relevant_pod_targets = pod_targets.select do |pod_target| user_build_configurations.keys.each do |config|
pod_target.include_in_build_config?(target_definition, config) relevant_pod_targets = pod_targets.select do |pod_target|
pod_target.include_in_build_config?(target_definition, config)
end
framework_paths_by_config[config] = relevant_pod_targets.flat_map(&:framework_paths)
end end
framework_paths_by_config[config] = relevant_pod_targets.flat_map(&:framework_paths) framework_paths_by_config
end end
framework_paths_by_config
end end
# @return [Hash{String => Array<String>}] Uniqued Resources grouped by config # @return [Hash{String => Array<String>}] Uniqued Resources grouped by config
# #
def resource_paths_by_config def resource_paths_by_config
relevant_pod_targets = pod_targets.reject do |pod_target| @resource_paths_by_config ||= begin
pod_target.should_build? && pod_target.requires_frameworks? relevant_pod_targets = pod_targets.reject do |pod_target|
end pod_target.should_build? && pod_target.requires_frameworks?
user_build_configurations.keys.each_with_object({}) do |config, resources_by_config| end
resources_by_config[config] = relevant_pod_targets.flat_map do |pod_target| user_build_configurations.keys.each_with_object({}) do |config, resources_by_config|
next [] unless pod_target.include_in_build_config?(target_definition, config) resources_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
(pod_target.resource_paths + [bridge_support_file].compact).uniq next [] unless pod_target.include_in_build_config?(target_definition, config)
(pod_target.resource_paths + [bridge_support_file].compact).uniq
end
end end
end end
end end
......
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