Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
78c6f0e6
Commit
78c6f0e6
authored
Jun 21, 2015
by
Boris Bügling
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3699 from vincentisambart/vi-cache-paths_for_attribute
Cache globbing in PathList to speed up pod install
parents
4263c6ad
844e3003
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
CHANGELOG.md
CHANGELOG.md
+3
-0
path_list.rb
lib/cocoapods/sandbox/path_list.rb
+7
-5
No files found.
CHANGELOG.md
View file @
78c6f0e6
...
@@ -51,6 +51,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -51,6 +51,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Dieter Komendera
](
https://github.com/kommen
)
[
Dieter Komendera
](
https://github.com/kommen
)
[
#2402
](
https://github.com/CocoaPods/CocoaPods/issues/2402
)
[
#2402
](
https://github.com/CocoaPods/CocoaPods/issues/2402
)
*
Cache globbing in
`PathList`
to speed up
`pod install`
.
[
Vincent Isambart
](
https://github.com/vincentisambart
)
##### Bug Fixes
##### Bug Fixes
*
Added recursive support to the public headers of vendored frameworks
*
Added recursive support to the public headers of vendored frameworks
...
...
lib/cocoapods/sandbox/path_list.rb
View file @
78c6f0e6
...
@@ -21,6 +21,7 @@ module Pod
...
@@ -21,6 +21,7 @@ module Pod
#
#
def
initialize
(
root
)
def
initialize
(
root
)
@root
=
root
@root
=
root
@glob_cache
=
{}
end
end
# @return [Array<String>] The list of absolute the path of all the files
# @return [Array<String>] The list of absolute the path of all the files
...
@@ -55,6 +56,7 @@ module Pod
...
@@ -55,6 +56,7 @@ module Pod
relative_paths
=
absolute_paths
.
map
{
|
p
|
p
[
root_length
..-
1
]
}
relative_paths
=
absolute_paths
.
map
{
|
p
|
p
[
root_length
..-
1
]
}
@files
=
relative_paths
-
relative_dirs
@files
=
relative_paths
-
relative_dirs
@dirs
=
relative_dirs
.
map
{
|
d
|
d
.
gsub
(
/\/\.\.?$/
,
''
)
}.
reject
{
|
d
|
d
==
'.'
||
d
==
'..'
}
.
uniq
@dirs
=
relative_dirs
.
map
{
|
d
|
d
.
gsub
(
/\/\.\.?$/
,
''
)
}.
reject
{
|
d
|
d
==
'.'
||
d
==
'..'
}
.
uniq
@glob_cache
=
{}
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
...
@@ -101,6 +103,10 @@ module Pod
...
@@ -101,6 +103,10 @@ module Pod
def
relative_glob
(
patterns
,
options
=
{})
def
relative_glob
(
patterns
,
options
=
{})
return
[]
if
patterns
.
empty?
return
[]
if
patterns
.
empty?
cache_key
=
options
.
merge
(
:patterns
=>
patterns
)
cached_value
=
@glob_cache
[
cache_key
]
return
cached_value
if
cached_value
dir_pattern
=
options
[
:dir_pattern
]
dir_pattern
=
options
[
:dir_pattern
]
exclude_patterns
=
options
[
:exclude_patterns
]
exclude_patterns
=
options
[
:exclude_patterns
]
include_dirs
=
options
[
:include_dirs
]
include_dirs
=
options
[
:include_dirs
]
...
@@ -112,7 +118,6 @@ module Pod
...
@@ -112,7 +118,6 @@ module Pod
end
end
list
=
Array
(
patterns
).
map
do
|
pattern
|
list
=
Array
(
patterns
).
map
do
|
pattern
|
if
pattern
.
is_a?
(
String
)
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
...
@@ -123,9 +128,6 @@ module Pod
...
@@ -123,9 +128,6 @@ module Pod
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
end
end
else
full_list
.
select
{
|
path
|
path
.
match
(
pattern
)
}
end
end
.
flatten
end
.
flatten
list
=
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
list
=
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
...
@@ -133,7 +135,7 @@ module Pod
...
@@ -133,7 +135,7 @@ module Pod
exclude_options
=
{
:dir_pattern
=>
'**/*'
,
:include_dirs
=>
include_dirs
}
exclude_options
=
{
:dir_pattern
=>
'**/*'
,
:include_dirs
=>
include_dirs
}
list
-=
relative_glob
(
exclude_patterns
,
exclude_options
)
list
-=
relative_glob
(
exclude_patterns
,
exclude_options
)
end
end
list
@glob_cache
[
cache_key
]
=
list
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment