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
cd57041f
Commit
cd57041f
authored
Jun 26, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Document platform compatibility predicate
parent
fc1ae63a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
resolver.rb
lib/cocoapods/resolver.rb
+18
-8
No files found.
lib/cocoapods/resolver.rb
View file @
cd57041f
...
@@ -186,7 +186,7 @@ module Pod
...
@@ -186,7 +186,7 @@ module Pod
requirement_satisfied
&&
!
(
requirement_satisfied
&&
!
(
spec
.
version
.
prerelease?
&&
spec
.
version
.
prerelease?
&&
existing_vertices
.
flat_map
(
&
:requirements
).
none?
{
|
r
|
r
.
prerelease?
||
r
.
external_source
||
r
.
head?
}
existing_vertices
.
flat_map
(
&
:requirements
).
none?
{
|
r
|
r
.
prerelease?
||
r
.
external_source
||
r
.
head?
}
)
&&
plat
?
(
activated
,
requirement
,
spec
)
)
&&
spec_is_platform_compatible
?
(
activated
,
requirement
,
spec
)
end
end
# Sort dependencies so that the ones that are easiest to resolve are first.
# Sort dependencies so that the ones that are easiest to resolve are first.
...
@@ -400,14 +400,24 @@ module Pod
...
@@ -400,14 +400,24 @@ module Pod
raise
Informative
,
error
.
message
raise
Informative
,
error
.
message
end
end
def
plat?
(
dg
,
req
,
spec
)
# Returns whether the given spec is platform-compatible with the dependency
inc
=
->
(
vert
)
do
# graph, taking into account the dependency that has required the spec.
pred
=
vert
.
predecessors
#
pred
+
pred
.
map
(
&
inc
).
reduce
(
Set
.
new
,
&
:&
)
<<
vert
# @param [Molinillo::DependencyGraph] dependency_graph
#
# @param [Dependency] dependency
#
# @param [Specification] specification
#
# @return [Bool]
def
spec_is_platform_compatible?
(
dependency_graph
,
dependency
,
spec
)
all_predecessors
=
->
(
vertex
)
do
pred
=
vertex
.
predecessors
pred
+
pred
.
map
(
&
all_predecessors
).
reduce
(
Set
.
new
,
&
:&
)
<<
vertex
end
end
v
=
dg
.
vertex_named
(
req
.
name
)
v
ertex
=
dependency_graph
.
vertex_named
(
dependency
.
name
)
all_inc
=
inc
[
v
]
predecessors
=
all_predecessors
[
vertex
]
platforms_to_satisfy
=
all_inc
.
map
(
&
:requirements
).
flat_map
{
|
r
|
@platforms_by_dependency
[
r
]
}
platforms_to_satisfy
=
predecessors
.
map
(
&
:requirements
).
flat_map
{
|
r
|
@platforms_by_dependency
[
r
]
}
platforms_to_satisfy
.
all?
{
|
pts
|
spec
.
available_platforms
.
any?
{
|
p
|
pts
.
supports?
(
p
)
}
}
platforms_to_satisfy
.
all?
{
|
pts
|
spec
.
available_platforms
.
any?
{
|
p
|
pts
.
supports?
(
p
)
}
}
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