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
2c0df3a0
Commit
2c0df3a0
authored
Oct 31, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Extract edge_is_valid_for_target? method
parent
b1dc3f7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
resolver.rb
lib/cocoapods/resolver.rb
+18
-4
No files found.
lib/cocoapods/resolver.rb
View file @
2c0df3a0
...
@@ -354,13 +354,27 @@ module Pod
...
@@ -354,13 +354,27 @@ module Pod
#
#
def
valid_dependencies_for_target_from_node
(
target
,
node
)
def
valid_dependencies_for_target_from_node
(
target
,
node
)
dependency_nodes
=
node
.
outgoing_edges
.
select
do
|
edge
|
dependency_nodes
=
node
.
outgoing_edges
.
select
do
|
edge
|
edge
.
requirements
.
any?
do
|
dependency
|
edge_is_valid_for_target?
(
edge
,
target
)
!
dependency
.
from_subspec_dependency?
||
edge
.
destination
.
payload
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
supports?
(
p
)
}
end
end
.
map
(
&
:destination
)
end
.
map
(
&
:destination
)
dependency_nodes
+
dependency_nodes
.
flat_map
{
|
n
|
valid_dependencies_for_target_from_node
(
target
,
n
)
}
dependency_nodes
+
dependency_nodes
.
flat_map
{
|
n
|
valid_dependencies_for_target_from_node
(
target
,
n
)
}
end
end
# Whether the given `edge` should be followed to find dependencies for the
# given `target`.
#
# @note At the moment, this method only checks whether the edge's
# requirements are normal dependencies _or_ whether they are
# dependencies that come from {Specification#subspec_dependencies}
# and, if so, that their platforms are compatible with the target's.
#
# @return [Bool]
#
def
edge_is_valid_for_target?
(
edge
,
target
)
edge
.
requirements
.
any?
do
|
dependency
|
!
dependency
.
from_subspec_dependency?
||
edge
.
destination
.
payload
.
available_platforms
.
any?
{
|
p
|
target
.
platform
.
supports?
(
p
)
}
end
end
end
end
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