Unverified Commit 2619458c authored by Muhammed Yavuz Nuzumlalı's avatar Muhammed Yavuz Nuzumlalı Committed by GitHub

Merge pull request #7473 from CocoaPods/manu-pathlist-glob-performance

Improve `pod install` performance for pods with exact file paths rather than glob patterns
parents d60ff0ec c30bb72c
......@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
* Improve `pod install` performance for pods with exact file paths rather than glob patterns
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
[#7473](https://github.com/CocoaPods/CocoaPods/pull/7473)
* Add support for modular header search paths, include "legacy" support.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7412](https://github.com/CocoaPods/CocoaPods/pull/7412)
......
......@@ -58,9 +58,7 @@ module Pod
# @return [void]
#
def refresh_file_accessors
file_accessors.each do |fa|
fa.path_list.read_file_system
end
file_accessors.map(&:path_list).uniq.each(&:read_file_system)
end
# Adds the source files of the Pods to the Pods project.
......
......@@ -128,19 +128,25 @@ module Pod
else
full_list = files
end
patterns_array = Array(patterns)
exact_matches = full_list & patterns_array
patterns_array -= exact_matches
list = Array(patterns).map do |pattern|
all_patterns = patterns_array.map do |pattern|
if directory?(pattern) && dir_pattern
pattern += '/' unless pattern.end_with?('/')
pattern += dir_pattern
end
expanded_patterns = dir_glob_equivalent_patterns(pattern)
full_list.select do |path|
expanded_patterns.any? do |p|
dir_glob_equivalent_patterns(pattern)
end.flatten
list = exact_matches
unless all_patterns.empty?
list += full_list.select do |path|
all_patterns.any? do |p|
File.fnmatch(p, path, File::FNM_CASEFOLD | File::FNM_PATHNAME)
end
end
end.flatten
end
list = list.map { |path| Pathname.new(path) }
if exclude_patterns
......
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