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
3db51207
Unverified
Commit
3db51207
authored
Mar 20, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Mar 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7524 from 0mega/allow-skipping-pod-update
Allows to skip update operation for specific pods
parents
bf310672
ea85925b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
1 deletion
+73
-1
CHANGELOG.md
CHANGELOG.md
+5
-0
update.rb
lib/cocoapods/command/update.rb
+16
-0
update_spec.rb
spec/functional/command/update_spec.rb
+52
-1
No files found.
CHANGELOG.md
View file @
3db51207
...
...
@@ -8,6 +8,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
*
Add
`--exclude-pods`
option to
`pod update`
to allow excluding specific pods from update
[
Oleksandr Kruk
](
https://github.com/0mega
)
[
#7334
](
https://github.com/CocoaPods/CocoaPods/issues/7334
)
*
Improve
`pod install`
performance for pods with exact file paths rather than glob patterns
[
Muhammed Yavuz Nuzumlalı
](
https://github.com/manuyavuz
)
[
#7473
](
https://github.com/CocoaPods/CocoaPods/pull/7473
)
...
...
lib/cocoapods/command/update.rb
View file @
3db51207
...
...
@@ -23,6 +23,7 @@ module Pod
[
[
'--sources=https://github.com/artsy/Specs,master'
,
'The sources from which to update dependent pods. '
\
'Multiple sources must be comma-delimited. The master repo will not be included by default with this option.'
],
[
'--exclude-pods=podName'
,
'Pods to exclude during update. Multiple pods must be comma-delimited.'
],
].
concat
(
super
)
end
...
...
@@ -30,6 +31,7 @@ module Pod
@pods
=
argv
.
arguments!
unless
argv
.
arguments
.
empty?
source_urls
=
argv
.
option
(
'sources'
,
''
).
split
(
','
)
excluded_pods
=
argv
.
option
(
'exclude-pods'
,
''
).
split
(
','
)
unless
source_urls
.
empty?
source_pods
=
source_urls
.
flat_map
{
|
url
|
config
.
sources_manager
.
source_with_name_or_url
(
url
).
pods
}
unless
source_pods
.
empty?
...
...
@@ -42,6 +44,20 @@ module Pod
end
end
unless
excluded_pods
.
empty?
@pods
||=
config
.
lockfile
.
pod_names
.
dup
non_installed_pods
=
(
excluded_pods
-
@pods
)
unless
non_installed_pods
.
empty?
pluralized_words
=
non_installed_pods
.
length
>
1
?
%w(Pods are)
:
%w(Pod is)
message
=
"Trying to skip `
#{
non_installed_pods
.
join
(
'`, `'
)
}
`
#{
pluralized_words
.
first
}
"
\
"which
#{
pluralized_words
.
last
}
not installed"
raise
Informative
,
message
end
@pods
.
delete_if
{
|
pod
|
excluded_pods
.
include?
(
pod
)
}
end
super
end
...
...
spec/functional/command/update_spec.rb
View file @
3db51207
...
...
@@ -15,6 +15,8 @@ module Pod
File
.
open
(
file
,
'w'
)
do
|
f
|
f
.
puts
(
'platform :ios'
)
f
.
puts
(
'pod "BananaLib", "1.0"'
)
f
.
puts
(
'pod "CoconutLib", "1.0"'
)
f
.
puts
(
'pod "OCMock", "3.4"'
)
end
end
...
...
@@ -22,12 +24,22 @@ module Pod
podfile
=
Podfile
.
new
do
platform
:ios
pod
'BananaLib'
,
'1.0'
pod
'CoconutLib'
,
'1.0'
pod
'OCMock'
,
'3.4'
end
specs
=
[
Specification
.
new
do
|
s
|
s
.
name
=
'BananaLib'
s
.
version
=
'1.0'
end
,
Specification
.
new
do
|
s
|
s
.
name
=
'CoconutLib'
s
.
version
=
'2.0'
end
,
Specification
.
new
do
|
s
|
s
.
name
=
'OCMock'
s
.
version
=
'3.4'
end
,
]
external_sources
=
{}
specs_by_source
=
{
...
...
@@ -90,7 +102,7 @@ module Pod
end
it
'updates pods in repo and in lockfile'
do
Installer
.
any_instance
.
expects
(
:update
=
).
with
(
:pods
=>
[
'BananaLib'
]
)
Installer
.
any_instance
.
expects
(
:update
=
).
with
(
:pods
=>
%w(BananaLib CoconutLib OCMock)
)
run_command
(
'update'
,
'--sources=master'
)
end
end
...
...
@@ -118,6 +130,45 @@ module Pod
exception
.
message
.
should
.
include
'Pods `Reachability`, `BananaLib2` are not installed and cannot be updated'
end
end
describe
'ignored pods'
do
before
do
generate_lockfile
end
describe
'successfully ignores skipped pods'
do
before
do
Installer
.
any_instance
.
expects
(
:install!
)
end
it
'ignores skiped pod'
do
Installer
.
any_instance
.
expects
(
:update
=
).
with
(
:pods
=>
%w(BananaLib CoconutLib)
)
run_command
(
'update'
,
'--exclude-pods=OCMock'
)
end
it
'ignores multiple skipped pods'
do
Installer
.
any_instance
.
expects
(
:update
=
).
with
(
:pods
=>
[
'OCMock'
])
run_command
(
'update'
,
'--exclude-pods=BananaLib,CoconutLib'
)
end
end
describe
'when a single supplied Pod is not installed'
do
it
'raises with single message'
do
should
.
raise
Informative
do
run_command
(
'update'
,
'--exclude-pods=Reachability,BananaLib'
)
end
.
message
.
should
.
include
'Trying to skip `Reachability` Pod which is not installed'
end
end
describe
'when multiple supplied Pods are not installed'
do
it
'raises with plural message'
do
should
.
raise
Informative
do
run_command
(
'update'
,
'--exclude-pods=Reachability,Alamofire'
)
end
.
message
.
should
.
include
'Trying to skip `Reachability`, `Alamofire` '
\
'Pods which are not installed'
end
end
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