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
0c256275
Commit
0c256275
authored
Aug 02, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Resolver] Make the version conflict message explain when deployment targets conflict
parent
82edf681
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
CHANGELOG.md
CHANGELOG.md
+5
-0
resolver.rb
lib/cocoapods/resolver.rb
+10
-2
resolver_spec.rb
spec/unit/resolver_spec.rb
+10
-0
No files found.
CHANGELOG.md
View file @
0c256275
...
...
@@ -22,6 +22,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#3764
](
https://github.com/CocoaPods/CocoaPods/issues/3764
)
*
The resolver error message when a conflict occurred due to platform deployment
target mismatches will now explain that.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#3926
](
https://github.com/CocoaPods/CocoaPods/issues/3926
)
## 0.38.2
...
...
lib/cocoapods/resolver.rb
View file @
0c256275
...
...
@@ -370,22 +370,30 @@ module Pod
# @param [Molinillo::ResolverError] error
#
def
handle_resolver_error
(
error
)
message
=
error
.
message
case
error
when
Molinillo
::
VersionConflict
error
.
conflicts
.
each
do
|
name
,
conflict
|
lockfile_reqs
=
conflict
.
requirements
[
name_for_locking_dependency_source
]
if
lockfile_reqs
&&
lockfile_reqs
.
last
&&
lockfile_reqs
.
last
.
prerelease?
&&
!
conflict
.
existing
raise
Informative
,
'Due to the previous naïve CocoaPods resolver, '
\
message
=
'Due to the previous naïve CocoaPods resolver, '
\
"you were using a pre-release version of `
#{
name
}
`, "
\
'without explicitly asking for a pre-release version, which now leads to a conflict. '
\
'Please decide to either use that pre-release version by adding the '
\
'version requirement to your Podfile '
\
"(e.g. `pod '
#{
name
}
', '
#{
lockfile_reqs
.
map
(
&
:requirement
).
join
(
"', '"
)
}
'`) "
\
"or revert to a stable version by running `pod update
#{
name
}
`."
elsif
!
conflict
.
existing
conflict
.
requirements
.
values
.
flatten
.
each
do
|
r
|
unless
search_for
(
r
).
empty?
message
<<
"
\n\n
Specs satisfying the `
#{
r
}
` dependency were found, "
\
'but they required a higher minimum deployment target.'
end
end
end
end
end
raise
Informative
,
error
.
message
raise
Informative
,
message
end
# Returns whether the given spec is platform-compatible with the dependency
...
...
spec/unit/resolver_spec.rb
View file @
0c256275
...
...
@@ -191,6 +191,16 @@ module Pod
]
end
it
'raises an informative error when version conflicts are caused by platform incompatibilities'
do
@podfile
=
Podfile
.
new
do
platform
:osx
,
'10.7'
pod
'AFNetworking'
,
'2.0.0'
# requires 10.8
end
@resolver
.
stubs
(
:podfile
).
returns
(
@podfile
)
message
=
should
.
raise
(
Informative
)
{
@resolver
.
resolve
}.
message
message
.
should
.
match
/required a higher minimum deployment target/
end
it
'raises if unable to find a specification'
do
Specification
.
any_instance
.
stubs
(
:all_dependencies
).
returns
([
Dependency
.
new
(
'Windows'
)])
message
=
should
.
raise
Informative
do
...
...
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