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
f18245f3
Commit
f18245f3
authored
May 09, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5261 from CocoaPods/conflict_errors
Improve messaging when dependencies conflict
parents
66b37f69
39a41037
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
14 deletions
+41
-14
CHANGELOG.md
CHANGELOG.md
+4
-0
resolver.rb
lib/cocoapods/resolver.rb
+16
-14
resolver_spec.rb
spec/unit/resolver_spec.rb
+21
-0
No files found.
CHANGELOG.md
View file @
f18245f3
...
@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#5218
](
https://github.com/CocoaPods/CocoaPods/issues/5218
)
[
#5218
](
https://github.com/CocoaPods/CocoaPods/issues/5218
)
*
Improvements to the error messaging around missing dependencies.
[
Orta Therox
](
https://github.com/orta
)
[
#5260
](
https://github.com/CocoaPods/CocoaPods/issues/5260
)
##### Bug Fixes
##### Bug Fixes
*
None.
*
None.
...
...
lib/cocoapods/resolver.rb
View file @
f18245f3
...
@@ -419,20 +419,22 @@ module Pod
...
@@ -419,20 +419,22 @@ module Pod
end
end
message
<<
"
\n
You should explicitly specify the version in order to install a pre-release version"
message
<<
"
\n
You should explicitly specify the version in order to install a pre-release version"
elsif
!
conflict
.
existing
elsif
!
conflict
.
existing
conflict
.
requirements
.
values
.
flatten
.
uniq
.
each
do
|
r
|
conflicts
=
conflict
.
requirements
.
values
.
flatten
.
uniq
if
search_for
(
r
).
empty?
found_conflicted_specs
=
conflicts
.
reject
{
|
c
|
search_for
(
c
).
empty?
}
# There are no existing specification inside any of the spec repos with given requirements.
if
found_conflicted_specs
.
empty?
message
<<
"
\n\n
None of your spec sources contain a spec satisfying the dependency: `
#{
r
}
`."
\
# There are no existing specification inside any of the spec repos with given requirements.
"
\n\n
You have either:"
\
dependencies
=
conflicts
.
count
==
1
?
'dependency'
:
'dependencies'
"
\n
* out-of-date source repos which you can update with `pod repo update`."
\
message
<<
"
\n\n
None of your spec sources contain a spec satisfying "
\
"
\n
* mistyped the name or version."
\
"the
#{
dependencies
}
: `
#{
conflicts
.
join
(
', '
)
}
`."
\
"
\n
* not added the source repo that hosts the Podspec to your Podfile."
\
"
\n\n
You have either:"
\
"
\n\n
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
"
\n
* out-of-date source repos which you can update with `pod repo update`."
\
"
\n
* mistyped the name or version."
\
else
"
\n
* not added the source repo that hosts the Podspec to your Podfile."
\
message
<<
"
\n\n
Specs satisfying the `
#{
r
}
` dependency were found, "
\
"
\n\n
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
'but they required a higher minimum deployment target.'
end
else
message
<<
"
\n\n
Specs satisfying the `
#{
conflicts
.
join
(
', '
)
}
` dependency were found, "
\
'but they required a higher minimum deployment target.'
end
end
end
end
end
end
...
...
spec/unit/resolver_spec.rb
View file @
f18245f3
...
@@ -369,6 +369,27 @@ module Pod
...
@@ -369,6 +369,27 @@ module Pod
e
.
message
.
should
.
match
(
/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./
)
e
.
message
.
should
.
match
(
/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./
)
end
end
it
'raises with a list of dependencies if there are many dependencies but no versions of a dependency exists'
do
podfile
=
Podfile
.
new
do
platform
:ios
pod
'AFNetworking'
,
'3.0.1'
end
locked_deps
=
dependency_graph_from_array
([
Dependency
.
new
(
'AFNetworking'
,
'= 1.4'
)])
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
locked_deps
,
config
.
sources_manager
.
all
)
e
=
lambda
{
resolver
.
resolve
}.
should
.
raise
Informative
e
.
message
.
should
.
match
(
/Unable to satisfy the following requirements/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 3.0.1\)` required by `Podfile`/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 1.4\)` required by `Podfile.lock`/
)
e
.
message
.
should
.
match
(
/None of your spec sources contain a spec satisfying the dependencies:/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 3.0.1\), AFNetworking \(= 1.4\)`/
)
e
.
message
.
should
.
match
(
/You have either:/
)
e
.
message
.
should
.
match
(
/ * out-of-date source repos which you can update with `pod repo update`/
)
e
.
message
.
should
.
match
(
/ * not added the source repo that hosts the Podspec to your Podfile./
)
e
.
message
.
should
.
match
(
/ * out-of-date source repos which you can update with `pod repo update`/
)
e
.
message
.
should
.
match
(
/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./
)
end
it
'takes into account locked dependencies'
do
it
'takes into account locked dependencies'
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
:ios
platform
:ios
...
...
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