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
52bd3990
Commit
52bd3990
authored
Oct 07, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resolver-all-sources'
parents
77f29854
2571e819
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
16 deletions
+52
-16
CHANGELOG.md
CHANGELOG.md
+5
-0
Gemfile.lock
Gemfile.lock
+1
-1
resolver.rb
lib/cocoapods/resolver.rb
+16
-9
resolver_spec.rb
spec/unit/resolver_spec.rb
+30
-6
No files found.
CHANGELOG.md
View file @
52bd3990
...
@@ -60,6 +60,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -60,6 +60,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Kyle Fuller
](
https://github.com/kylef
)
[
Kyle Fuller
](
https://github.com/kylef
)
[
#2591
](
https://github.com/CocoaPods/CocoaPods/issues/2591
)
[
#2591
](
https://github.com/CocoaPods/CocoaPods/issues/2591
)
*
Take into account versions of a Pod from all specified sources when
resolving dependencies.
[
Thomas Visser
](
https://github.com/Thomvis
)
[
#2556
](
https://github.com/CocoaPods/CocoaPods/issues/2556
)
## 0.34.1
## 0.34.1
...
...
Gemfile.lock
View file @
52bd3990
...
@@ -7,7 +7,7 @@ GIT
...
@@ -7,7 +7,7 @@ GIT
GIT
GIT
remote: https://github.com/CocoaPods/Core.git
remote: https://github.com/CocoaPods/Core.git
revision: 1
59d93cb7576523efaf9856d069f5df23b29e646
revision: 1
0d6dc5a3615e738cd682fd05d3f658db8e53d73
branch: master
branch: master
specs:
specs:
cocoapods-core (0.34.1)
cocoapods-core (0.34.1)
...
...
lib/cocoapods/resolver.rb
View file @
52bd3990
...
@@ -150,6 +150,11 @@ module Pod
...
@@ -150,6 +150,11 @@ module Pod
set
=
find_cached_set
(
dependency
,
dependent_spec
)
set
=
find_cached_set
(
dependency
,
dependent_spec
)
set
.
required_by
(
dependency
,
dependent_spec
.
to_s
)
set
.
required_by
(
dependency
,
dependent_spec
.
to_s
)
if
(
paths
=
set
.
specification_paths_for_version
(
set
.
required_version
)).
length
>
1
UI
.
warn
"Found multiple specifications for
#{
dependency
}
:
\n
"
\
"-
#{
paths
.
join
(
"
\n
"
)
}
"
end
unless
@loaded_specs
.
include?
(
dependency
.
name
)
unless
@loaded_specs
.
include?
(
dependency
.
name
)
spec
=
set
.
specification
.
subspec_by_name
(
dependency
.
name
)
spec
=
set
.
specification
.
subspec_by_name
(
dependency
.
name
)
@loaded_specs
<<
spec
.
name
@loaded_specs
<<
spec
.
name
...
@@ -190,7 +195,7 @@ module Pod
...
@@ -190,7 +195,7 @@ module Pod
end
end
set
=
Specification
::
Set
::
External
.
new
(
spec
)
set
=
Specification
::
Set
::
External
.
new
(
spec
)
else
else
set
=
find
_set_from_sources
(
dependency
)
set
=
create
_set_from_sources
(
dependency
)
end
end
cached_sets
[
name
]
=
set
cached_sets
[
name
]
=
set
unless
set
unless
set
...
@@ -201,19 +206,21 @@ module Pod
...
@@ -201,19 +206,21 @@ module Pod
cached_sets
[
name
]
cached_sets
[
name
]
end
end
# @return [Set]
Load
s a set for the Pod of the given dependency from the
# @return [Set]
Create
s a set for the Pod of the given dependency from the
# sources. The set will
be limited to the versions of the firs
t
# sources. The set will
contain all versions from all sources tha
t
#
source which includes
the Pod.
#
include
the Pod.
#
#
# @param [Dependency] dependency
# @param [Dependency] dependency
# The dependency for which the set is needed.
# The dependency for which the set is needed.
#
#
def
find_set_from_sources
(
dependency
)
def
create_set_from_sources
(
dependency
)
sources
.
each
do
|
source
|
aggregate
.
search
(
dependency
)
set
=
source
.
search
(
dependency
)
return
set
if
set
end
end
nil
# @return [Source::Aggregate] The aggregate of the {#sources}.
#
def
aggregate
@aggregate
||=
Source
::
Aggregate
.
new
(
sources
.
map
(
&
:repo
))
end
end
# Ensures that a specification is compatible with the platform of a target.
# Ensures that a specification is compatible with the platform of a target.
...
...
spec/unit/resolver_spec.rb
View file @
52bd3990
...
@@ -234,20 +234,44 @@ COCOAPODS: 0.33.1
...
@@ -234,20 +234,44 @@ COCOAPODS: 0.33.1
version
.
to_s
.
should
==
'2.5.1'
version
.
to_s
.
should
==
'2.5.1'
end
end
it
'
takes into account the order of the sources
'
do
it
'
consults all sources when finding a matching spec
'
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
:ios
platform
:ios
pod
'JSONKit'
pod
'JSONKit'
,
'> 2'
end
end
file
=
fixture
(
'spec-repos/test_repo/JSONKit/999.999.999/JSONKit.podspec'
)
sources
=
SourcesManager
.
sources
(
%w(master test_repo)
)
sources
=
SourcesManager
.
sources
(
%w(master test_repo)
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
version
=
resolver
.
resolve
.
values
.
flatten
.
first
.
version
spec
=
resolver
.
resolve
.
values
.
flatten
.
first
version
.
to_s
.
should
.
not
==
'999.999.999'
spec
.
version
.
to_s
.
should
==
'999.999.999'
spec
.
defined_in_file
.
should
==
file
sources
=
SourcesManager
.
sources
(
%w(test_repo master)
)
sources
=
SourcesManager
.
sources
(
%w(test_repo master)
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
version
=
resolver
.
resolve
.
values
.
flatten
.
first
.
version
spec
=
resolver
.
resolve
.
values
.
flatten
.
first
version
.
to_s
.
should
==
'999.999.999'
spec
.
version
.
to_s
.
should
==
'999.999.999'
resolver
.
resolve
.
values
.
flatten
.
first
.
defined_in_file
.
should
==
file
end
it
'warns and chooses the first source when multiple sources contain '
\
'a pod'
do
podfile
=
Podfile
.
new
do
platform
:ios
pod
'JSONKit'
,
'1.4'
end
sources
=
SourcesManager
.
sources
(
%w(master test_repo)
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
spec
=
resolver
.
resolve
.
values
.
flatten
.
first
spec
.
version
.
to_s
.
should
==
'1.4'
spec
.
defined_in_file
.
should
==
fixture
(
'spec-repos/master/Specs/JSONKit/1.4/JSONKit.podspec.json'
)
sources
=
SourcesManager
.
sources
(
%w(test_repo master)
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
[],
sources
)
spec
=
resolver
.
resolve
.
values
.
flatten
.
first
spec
.
version
.
to_s
.
should
==
'1.4'
resolver
.
resolve
.
values
.
flatten
.
first
.
defined_in_file
.
should
==
fixture
(
'spec-repos/test_repo/JSONKit/1.4/JSONKit.podspec'
)
UI
.
warnings
.
should
.
match
/multiple specifications/
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