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
9a14419b
Commit
9a14419b
authored
Jan 12, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Fix multi-source resolution
parent
e9d352d0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
CHANGELOG.md
CHANGELOG.md
+5
-0
resolver.rb
lib/cocoapods/resolver.rb
+2
-3
lazy_specification.rb
lib/cocoapods/resolver/lazy_specification.rb
+6
-3
No files found.
CHANGELOG.md
View file @
9a14419b
...
...
@@ -18,6 +18,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7292
](
https://github.com/CocoaPods/CocoaPods/pull/7292
)
*
Fix resolution when multiple sources provide the same pods, and there are
(potential) dependencies between the sources.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#7031
](
https://github.com/CococaPods/CocoaPods/issues/7031
)
## 1.4.0.rc.1 (2017-12-16)
##### Enhancements
...
...
lib/cocoapods/resolver.rb
View file @
9a14419b
...
...
@@ -351,8 +351,7 @@ module Pod
all_specifications
(
installation_options
.
warn_for_multiple_pod_sources
).
select
{
|
s
|
requirement
.
satisfied_by?
s
.
version
}.
map
{
|
s
|
s
.
subspec_by_name
(
dependency
.
name
,
false
,
true
)
}.
compact
.
reverse
compact
end
# @return [Set] Loads or returns a previously initialized set for the Pod
...
...
@@ -508,7 +507,7 @@ module Pod
end
,
)
end
raise
type
,
message
raise
type
.
new
(
message
).
tap
{
|
e
|
e
.
set_backtrace
(
error
.
backtrace
)
}
end
# Returns whether the given spec is platform-compatible with the dependency
...
...
lib/cocoapods/resolver/lazy_specification.rb
View file @
9a14419b
...
...
@@ -37,12 +37,12 @@ module Pod
end
end
# returns the highest versioned spec last
def
all_specifications
(
warn_for_multiple_pod_sources
)
@all_specifications
||=
begin
sources_by_version
=
{}
versions_by_source
.
each
do
|
source
,
versions
|
versions
.
each
{
|
v
|
(
sources_by_version
[
v
]
||=
[])
<<
source
}
sources_by_version
end
if
warn_for_multiple_pod_sources
...
...
@@ -56,8 +56,11 @@ module Pod
end
end
versions_by_source
.
flat_map
do
|
source
,
versions
|
versions
.
map
{
|
version
|
LazySpecification
.
new
(
name
,
version
,
source
)
}
# sort versions from high to low
sources_by_version
.
sort_by
(
&
:first
).
flat_map
do
|
version
,
sources
|
# within each version, we want the prefered (first-specified) source
# to be the _last_ one
sources
.
reverse_each
.
map
{
|
source
|
LazySpecification
.
new
(
name
,
version
,
source
)
}
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