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
39a41037
Unverified
Commit
39a41037
authored
May 06, 2016
by
Orta Therox
Committed by
Samuel Giddins
May 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve messaging when dependencies conflict
parent
66b37f69
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
5 deletions
+32
-5
CHANGELOG.md
CHANGELOG.md
+4
-0
resolver.rb
lib/cocoapods/resolver.rb
+7
-5
resolver_spec.rb
spec/unit/resolver_spec.rb
+21
-0
No files found.
CHANGELOG.md
View file @
39a41037
...
@@ -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 @
39a41037
...
@@ -419,10 +419,13 @@ module Pod
...
@@ -419,10 +419,13 @@ 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?
}
if
found_conflicted_specs
.
empty?
# There are no existing specification inside any of the spec repos with given requirements.
# There are no existing specification inside any of the spec repos with given requirements.
message
<<
"
\n\n
None of your spec sources contain a spec satisfying the dependency: `
#{
r
}
`."
\
dependencies
=
conflicts
.
count
==
1
?
'dependency'
:
'dependencies'
message
<<
"
\n\n
None of your spec sources contain a spec satisfying "
\
"the
#{
dependencies
}
: `
#{
conflicts
.
join
(
', '
)
}
`."
\
"
\n\n
You have either:"
\
"
\n\n
You have either:"
\
"
\n
* out-of-date source repos which you can update with `pod repo update`."
\
"
\n
* out-of-date source repos which you can update with `pod repo update`."
\
"
\n
* mistyped the name or version."
\
"
\n
* mistyped the name or version."
\
...
@@ -430,13 +433,12 @@ module Pod
...
@@ -430,13 +433,12 @@ module Pod
"
\n\n
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
"
\n\n
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
else
else
message
<<
"
\n\n
Specs satisfying the `
#{
r
}
` dependency were found, "
\
message
<<
"
\n\n
Specs satisfying the `
#{
conflicts
.
join
(
', '
)
}
` dependency were found, "
\
'but they required a higher minimum deployment target.'
'but they required a higher minimum deployment target.'
end
end
end
end
end
end
end
end
end
raise
Informative
,
message
raise
Informative
,
message
end
end
...
...
spec/unit/resolver_spec.rb
View file @
39a41037
...
@@ -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