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
d14e6c70
Commit
d14e6c70
authored
Jun 22, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Take supported platforms into account when resolving
parent
e9ef020c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
resolver.rb
lib/cocoapods/resolver.rb
+18
-2
No files found.
lib/cocoapods/resolver.rb
View file @
d14e6c70
...
@@ -37,6 +37,7 @@ module Pod
...
@@ -37,6 +37,7 @@ module Pod
@podfile
=
podfile
@podfile
=
podfile
@locked_dependencies
=
locked_dependencies
@locked_dependencies
=
locked_dependencies
@sources
=
Array
(
sources
)
@sources
=
Array
(
sources
)
@platforms_by_dependency
=
Hash
.
new
{
|
h
,
k
|
h
[
k
]
=
[]
}
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
@@ -52,7 +53,11 @@ module Pod
...
@@ -52,7 +53,11 @@ module Pod
# definition.
# definition.
#
#
def
resolve
def
resolve
dependencies
=
podfile
.
target_definition_list
.
map
(
&
:dependencies
).
flatten
dependencies
=
podfile
.
target_definition_list
.
flat_map
do
|
target
|
target
.
dependencies
.
each
do
|
dep
|
@platforms_by_dependency
[
dep
]
<<
target
.
platform
end
end
@cached_sets
=
{}
@cached_sets
=
{}
@activated
=
Molinillo
::
Resolver
.
new
(
self
,
self
).
resolve
(
dependencies
,
locked_dependencies
)
@activated
=
Molinillo
::
Resolver
.
new
(
self
,
self
).
resolve
(
dependencies
,
locked_dependencies
)
specs_by_target
.
tap
do
|
specs_by_target
|
specs_by_target
.
tap
do
|
specs_by_target
|
...
@@ -181,7 +186,7 @@ module Pod
...
@@ -181,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
)
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.
...
@@ -395,6 +400,17 @@ module Pod
...
@@ -395,6 +400,17 @@ module Pod
raise
Informative
,
error
.
message
raise
Informative
,
error
.
message
end
end
def
plat?
(
dg
,
req
,
spec
)
inc
=
->
(
vert
)
{
pred
=
vert
.
predecessors
pred
+
pred
.
map
(
&
inc
).
reduce
(
Set
.
new
,
&
:&
)
<<
vert
}
v
=
dg
.
vertex_named
(
req
.
name
)
all_inc
=
inc
[
v
]
platforms_to_satisfy
=
all_inc
.
map
(
&
:requirements
).
flat_map
{
|
r
|
@platforms_by_dependency
[
r
]
}
platforms_to_satisfy
.
all?
{
|
pts
|
spec
.
available_platforms
.
any?
{
|
p
|
pts
.
supports?
(
p
)
}
}
end
# Returns the target-appropriate nodes that are `successors` of `node`,
# Returns the target-appropriate nodes that are `successors` of `node`,
# rejecting those that are scoped by target platform and have incompatible
# rejecting those that are scoped by target platform and have incompatible
# targets.
# targets.
...
...
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