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