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
4e6b852f
Commit
4e6b852f
authored
Mar 16, 2017
by
Ben Asher
Committed by
GitHub
Mar 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6553 from adellibovi/add-exit-code-no-spec-found
Return different exit status (31) when spec not found
parents
d2f30d88
a1d13773
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
CHANGELOG.md
CHANGELOG.md
+4
-0
install.rb
lib/cocoapods/command/install.rb
+4
-0
resolver.rb
lib/cocoapods/resolver.rb
+9
-1
resolver_spec.rb
spec/unit/resolver_spec.rb
+4
-2
No files found.
CHANGELOG.md
View file @
4e6b852f
...
@@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Alfredo Delli Bovi
](
https://github.com/adellibovi
)
[
Alfredo Delli Bovi
](
https://github.com/adellibovi
)
[
#6525
](
https://github.com/CocoaPods/CocoaPods/issues/6525
)
[
#6525
](
https://github.com/CocoaPods/CocoaPods/issues/6525
)
*
Return new exit code (31) when spec not found
[
Alfredo Delli Bovi
](
https://github.com/adellibovi
)
[
#6033
](
https://github.com/CocoaPods/CocoaPods/issues/6033
)
## 1.2.1.beta.1 (2017-03-08)
## 1.2.1.beta.1 (2017-03-08)
...
...
lib/cocoapods/command/install.rb
View file @
4e6b852f
...
@@ -21,6 +21,10 @@ module Pod
...
@@ -21,6 +21,10 @@ module Pod
This will configure the project to reference the Pods static library,
This will configure the project to reference the Pods static library,
add a build configuration file, and add a post build script to copy
add a build configuration file, and add a post build script to copy
Pod resources.
Pod resources.
This may return one of several error codes if it encounters problems.
* `1` Generic error code
* `31` Spec not found (i.e out-of-date source repos, mistyped Pod name etc...)
DESC
DESC
def
self
.
options
def
self
.
options
...
...
lib/cocoapods/resolver.rb
View file @
4e6b852f
...
@@ -2,6 +2,12 @@ require 'molinillo'
...
@@ -2,6 +2,12 @@ require 'molinillo'
require
'cocoapods/resolver/lazy_specification'
require
'cocoapods/resolver/lazy_specification'
module
Pod
module
Pod
class
NoSpecFoundError
<
Informative
def
exit_status
@exit_status
||=
31
end
end
# The resolver is responsible of generating a list of specifications grouped
# The resolver is responsible of generating a list of specifications grouped
# by target for a given Podfile.
# by target for a given Podfile.
#
#
...
@@ -389,6 +395,7 @@ module Pod
...
@@ -389,6 +395,7 @@ module Pod
#
#
def
handle_resolver_error
(
error
)
def
handle_resolver_error
(
error
)
message
=
error
.
message
.
dup
message
=
error
.
message
.
dup
type
=
Informative
case
error
case
error
when
Molinillo
::
VersionConflict
when
Molinillo
::
VersionConflict
error
.
conflicts
.
each
do
|
name
,
conflict
|
error
.
conflicts
.
each
do
|
name
,
conflict
|
...
@@ -427,6 +434,7 @@ module Pod
...
@@ -427,6 +434,7 @@ module Pod
found_conflicted_specs
=
conflicts
.
reject
{
|
c
|
search_for
(
c
).
empty?
}
found_conflicted_specs
=
conflicts
.
reject
{
|
c
|
search_for
(
c
).
empty?
}
if
found_conflicted_specs
.
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.
type
=
NoSpecFoundError
dependencies
=
conflicts
.
count
==
1
?
'dependency'
:
'dependencies'
dependencies
=
conflicts
.
count
==
1
?
'dependency'
:
'dependencies'
message
<<
"
\n\n
None of your spec sources contain a spec satisfying "
\
message
<<
"
\n\n
None of your spec sources contain a spec satisfying "
\
"the
#{
dependencies
}
: `
#{
conflicts
.
join
(
', '
)
}
`."
\
"the
#{
dependencies
}
: `
#{
conflicts
.
join
(
', '
)
}
`."
\
...
@@ -443,7 +451,7 @@ module Pod
...
@@ -443,7 +451,7 @@ module Pod
end
end
end
end
end
end
raise
Informativ
e
,
message
raise
typ
e
,
message
end
end
# Returns whether the given spec is platform-compatible with the dependency
# Returns whether the given spec is platform-compatible with the dependency
...
...
spec/unit/resolver_spec.rb
View file @
4e6b852f
...
@@ -373,7 +373,7 @@ module Pod
...
@@ -373,7 +373,7 @@ module Pod
pod
'AFNetworking'
,
'999.999.999'
pod
'AFNetworking'
,
'999.999.999'
end
end
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
empty_graph
,
config
.
sources_manager
.
all
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
empty_graph
,
config
.
sources_manager
.
all
)
e
=
lambda
{
resolver
.
resolve
}.
should
.
raise
Informative
e
=
lambda
{
resolver
.
resolve
}.
should
.
raise
NoSpecFoundError
e
.
message
.
should
.
match
(
/Unable to satisfy the following requirements/
)
e
.
message
.
should
.
match
(
/Unable to satisfy the following requirements/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 999\.999\.999\)` required by `Podfile`/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 999\.999\.999\)` required by `Podfile`/
)
e
.
message
.
should
.
match
(
/None of your spec sources contain a spec satisfying the dependency: `AFNetworking \(= 999\.999\.999\)`./
)
e
.
message
.
should
.
match
(
/None of your spec sources contain a spec satisfying the dependency: `AFNetworking \(= 999\.999\.999\)`./
)
...
@@ -382,6 +382,7 @@ module Pod
...
@@ -382,6 +382,7 @@ module Pod
e
.
message
.
should
.
match
(
/ * not added the source repo that hosts the Podspec to your Podfile./
)
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
(
/ * 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./
)
e
.
message
.
should
.
match
(
/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./
)
e
.
exit_status
.
should
.
equal
(
31
)
end
end
it
'raises with a list of dependencies if there are many dependencies but no versions of a dependency exists'
do
it
'raises with a list of dependencies if there are many dependencies but no versions of a dependency exists'
do
...
@@ -392,7 +393,7 @@ module Pod
...
@@ -392,7 +393,7 @@ module Pod
locked_deps
=
dependency_graph_from_array
([
Dependency
.
new
(
'AFNetworking'
,
'= 1.4'
)])
locked_deps
=
dependency_graph_from_array
([
Dependency
.
new
(
'AFNetworking'
,
'= 1.4'
)])
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
locked_deps
,
config
.
sources_manager
.
all
)
resolver
=
Resolver
.
new
(
config
.
sandbox
,
podfile
,
locked_deps
,
config
.
sources_manager
.
all
)
e
=
lambda
{
resolver
.
resolve
}.
should
.
raise
Informative
e
=
lambda
{
resolver
.
resolve
}.
should
.
raise
NoSpecFoundError
e
.
message
.
should
.
match
(
/Unable to satisfy the following requirements/
)
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 \(= 3.0.1\)` required by `Podfile`/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 1.4\)` required by `Podfile.lock`/
)
e
.
message
.
should
.
match
(
/`AFNetworking \(= 1.4\)` required by `Podfile.lock`/
)
...
@@ -403,6 +404,7 @@ module Pod
...
@@ -403,6 +404,7 @@ module Pod
e
.
message
.
should
.
match
(
/ * not added the source repo that hosts the Podspec to your Podfile./
)
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
(
/ * 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./
)
e
.
message
.
should
.
match
(
/Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default./
)
e
.
exit_status
.
should
.
equal
(
31
)
end
end
it
'takes into account locked dependencies'
do
it
'takes into account locked dependencies'
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