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
e05cc709
Commit
e05cc709
authored
Oct 01, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DirList] Support for excluded patterns
parent
9b24e307
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
local_pod.rb
lib/cocoapods/local_pod.rb
+3
-3
dir_list.rb
lib/cocoapods/local_pod/dir_list.rb
+18
-8
specification.rb
lib/cocoapods/specification.rb
+3
-0
No files found.
lib/cocoapods/local_pod.rb
View file @
e05cc709
...
...
@@ -502,7 +502,7 @@ module Pod
specs
=
specs
.
sort_by
{
|
s
|
s
.
name
.
length
}
specs
.
each
do
|
spec
|
paths
=
expanded_paths
(
spec
.
send
(
accessor
),
dir_pattern
)
paths
=
expanded_paths
(
spec
.
send
(
accessor
),
dir_pattern
,
spec
.
excluded_patterns
)
unless
paths
.
empty?
paths_by_spec
[
spec
]
=
paths
-
processed_paths
processed_paths
+=
paths
...
...
@@ -527,7 +527,7 @@ module Pod
#
# @return [Array<Pathname>] A list of the paths.
#
def
expanded_paths
(
patterns
,
dir_pattern
=
nil
)
def
expanded_paths
(
patterns
,
dir_pattern
=
nil
,
exclude_patterns
=
nil
)
unless
exists?
raise
Informative
,
"[Local Pod] Attempt to resolve paths for nonexistent pod.
\n
"
\
"
\t
Specifications:
#{
@specifications
.
inspect
}
\n
"
\
...
...
@@ -547,7 +547,7 @@ module Pod
file_list
.
prepend_patterns
(
root
)
file_list
.
glob
end
result
<<
dir_list
.
glob
(
glob_patterns
,
dir_pattern
)
result
<<
dir_list
.
glob
(
glob_patterns
,
dir_pattern
,
exclude_patterns
)
result
.
flatten
.
compact
.
uniq
end
...
...
lib/cocoapods/local_pod/dir_list.rb
View file @
e05cc709
...
...
@@ -57,8 +57,8 @@ module Pod
# @return [Array<Pathname>] Similar to {glob} but returns the absolute
# paths.
#
def
glob
(
patterns
,
dir_pattern
=
nil
)
relative_glob
(
patterns
,
dir_pattern
).
map
{
|
p
|
root
+
p
}
def
glob
(
patterns
,
dir_pattern
=
nil
,
exclude_patterns
=
nil
)
relative_glob
(
patterns
,
dir_pattern
,
exclude_patterns
).
map
{
|
p
|
root
+
p
}
end
# @return [Array<Pathname>] The list of the relative paths that are
...
...
@@ -71,17 +71,27 @@ module Pod
# pattern, if this one is the path of a
# directory.
#
def
relative_glob
(
patterns
,
dir_pattern
=
nil
)
def
relative_glob
(
patterns
,
dir_pattern
=
nil
,
exclude_patterns
=
nil
)
return
[]
if
patterns
.
empty?
patterns
=
[
patterns
]
if
patterns
.
is_a?
String
list
=
patterns
.
map
do
|
pattern
|
pattern
+=
'/'
+
dir_pattern
if
directory?
(
pattern
)
&&
dir_pattern
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
files
.
select
do
|
path
|
expanded_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
if
pattern
.
is_a?
(
String
)
pattern
+=
'/'
+
dir_pattern
if
directory?
(
pattern
)
&&
dir_pattern
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
files
.
select
do
|
path
|
expanded_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
else
pattern
.
to_s
.
cyan
files
.
select
{
|
path
|
path
.
match
(
pattern
)
}
end
end
.
flatten
if
exclude_patterns
excluded
=
relative_glob
(
exclude_patterns
)
list
=
exclude_patterns
?
list
-
excluded
:
list
end
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
end
...
...
lib/cocoapods/specification.rb
View file @
e05cc709
...
...
@@ -40,6 +40,7 @@ module Pod
# multi-platform attributes
%w[ source_files
excluded_patterns
public_header_files
resources
preserve_paths
...
...
@@ -136,6 +137,7 @@ module Pod
end
%w{ source_files=
excluded_patterns=
public_header_files=
resource=
resources=
...
...
@@ -259,6 +261,7 @@ module Pod
top_attr_accessor
:prefix_header_contents
pltf_chained_attr_accessor
:source_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:excluded_patterns
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:public_header_files
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:resources
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
pltf_chained_attr_accessor
:preserve_paths
,
lambda
{
|
value
,
current
|
pattern_list
(
value
)
}
# Paths that should not be cleaned
...
...
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