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
92b0f349
Commit
92b0f349
authored
Jan 30, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Project] Speed up adding file references slightly
parent
e35c3a27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
project.rb
lib/cocoapods/project.rb
+5
-7
No files found.
lib/cocoapods/project.rb
View file @
92b0f349
...
@@ -336,28 +336,26 @@ module Pod
...
@@ -336,28 +336,26 @@ module Pod
relative_base
=
base_path
.
nil?
?
group
.
real_path
:
base_path
.
realdirpath
relative_base
=
base_path
.
nil?
?
group
.
real_path
:
base_path
.
realdirpath
relative_pathname
=
absolute_pathname
.
relative_path_from
(
relative_base
)
relative_pathname
=
absolute_pathname
.
relative_path_from
(
relative_base
)
relative_dir
=
relative_pathname
.
dirname
relative_dir
=
relative_pathname
.
dirname
lproj_regex
=
/\.lproj/i
# Add subgroups for directories, but treat .lproj as a file
# Add subgroups for directories, but treat .lproj as a file
if
reflect_file_system_structure
if
reflect_file_system_structure
path
=
relative_base
path
=
relative_base
relative_dir
.
each_filename
do
|
name
|
relative_dir
.
each_filename
do
|
name
|
break
if
name
.
to_s
=~
lproj_regex
break
if
name
.
to_s
.
downcase
.
include?
'.lproj'
next
if
name
==
'.'
next
if
name
==
'.'
# Make sure groups have the correct absolute path set, as intermittent
# Make sure groups have the correct absolute path set, as intermittent
# directories may not be included in the group structure
# directories may not be included in the group structure
path
+=
name
path
+=
name
group
=
group
[
name
]
||
group
.
new_group
(
name
,
path
)
group
=
group
.
children
.
find
{
|
c
|
c
.
display_name
==
name
}
||
group
.
new_group
(
name
,
path
)
end
end
end
end
# Turn files inside .lproj directories into a variant group
# Turn files inside .lproj directories into a variant group
if
relative_dir
.
basename
.
to_s
=~
lproj_regex
if
relative_dir
.
basename
.
to_s
.
downcase
.
include?
'.lproj'
group_name
=
variant_group_name
(
absolute_pathname
)
group_name
=
variant_group_name
(
absolute_pathname
)
lproj_parent_dir
=
absolute_pathname
.
dirname
.
dirname
lproj_parent_dir
=
absolute_pathname
.
dirname
.
dirname
group
=
@variant_groups_by_path_and_name
[[
lproj_parent_dir
,
group_name
]]
||
group
=
@variant_groups_by_path_and_name
[[
lproj_parent_dir
,
group_name
]]
||=
group
.
new_variant_group
(
group_name
,
lproj_parent_dir
)
group
.
new_variant_group
(
group_name
,
lproj_parent_dir
)
@variant_groups_by_path_and_name
[[
lproj_parent_dir
,
group_name
]]
||=
group
end
end
group
group
...
...
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