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
2acb073e
Commit
2acb073e
authored
Feb 27, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display a message when a pods source has changed during installation
parent
3edf0f3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
7 deletions
+66
-7
CHANGELOG.md
CHANGELOG.md
+4
-0
Gemfile.lock
Gemfile.lock
+1
-1
installer.rb
lib/cocoapods/installer.rb
+11
-2
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+49
-3
No files found.
CHANGELOG.md
View file @
2acb073e
...
@@ -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`
[
Muhammed Yavuz Nuzumlalı
](
https://github.com/manuyavuz
)
[
Muhammed Yavuz Nuzumlalı
](
https://github.com/manuyavuz
)
[
#7473
](
https://github.com/CocoaPods/CocoaPods/pull/7473
)
[
#7473
](
https://github.com/CocoaPods/CocoaPods/pull/7473
)
*
Display a message when a pods source has changed during installation
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7464
](
https://github.com/CocoaPods/CocoaPods/pull/7464
)
*
Add support for modular header search paths, include "legacy" support.
*
Add support for modular header search paths, include "legacy" support.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7412
](
https://github.com/CocoaPods/CocoaPods/pull/7412
)
[
#7412
](
https://github.com/CocoaPods/CocoaPods/pull/7412
)
...
...
Gemfile.lock
View file @
2acb073e
...
@@ -7,7 +7,7 @@ GIT
...
@@ -7,7 +7,7 @@ GIT
GIT
GIT
remote: https://github.com/CocoaPods/Core.git
remote: https://github.com/CocoaPods/Core.git
revision:
e0c6884b37ab6a44095a2bbdbfe9032627a90388
revision:
1a92ff1b5aa2bd21b9694d0941406aff328fdd2a
branch: master
branch: master
specs:
specs:
cocoapods-core (1.4.0)
cocoapods-core (1.4.0)
...
...
lib/cocoapods/installer.rb
View file @
2acb073e
...
@@ -321,8 +321,17 @@ module Pod
...
@@ -321,8 +321,17 @@ module Pod
root_specs
.
sort_by
(
&
:name
).
each
do
|
spec
|
root_specs
.
sort_by
(
&
:name
).
each
do
|
spec
|
if
pods_to_install
.
include?
(
spec
.
name
)
if
pods_to_install
.
include?
(
spec
.
name
)
if
sandbox_state
.
changed
.
include?
(
spec
.
name
)
&&
sandbox
.
manifest
if
sandbox_state
.
changed
.
include?
(
spec
.
name
)
&&
sandbox
.
manifest
previous
=
sandbox
.
manifest
.
version
(
spec
.
name
)
current_version
=
spec
.
version
title
=
"Installing
#{
spec
.
name
}
#{
spec
.
version
}
(was
#{
previous
}
)"
previous_version
=
sandbox
.
manifest
.
version
(
spec
.
name
)
has_changed_version
=
current_version
!=
previous_version
current_repo
=
analysis_result
.
specs_by_source
.
detect
{
|
key
,
values
|
break
key
if
values
.
map
(
&
:name
).
include?
(
spec
.
name
)
}
current_repo
&&=
current_repo
.
url
||
current_repo
.
name
previous_spec_repo
=
sandbox
.
manifest
.
spec_repo
(
spec
.
name
)
has_changed_repo
=
!
previous_spec_repo
.
nil?
&&
current_repo
&&
(
current_repo
!=
previous_spec_repo
)
title
=
"Installing
#{
spec
.
name
}
#{
spec
.
version
}
"
title
<<
" (was
#{
previous_version
}
and source changed to `
#{
current_repo
}
` from `
#{
previous_spec_repo
}
`)"
if
has_changed_version
&&
has_changed_repo
title
<<
" (was
#{
previous_version
}
)"
if
has_changed_version
&&
!
has_changed_repo
title
<<
" (source changed to `
#{
current_repo
}
` from `
#{
previous_spec_repo
}
`)"
if
!
has_changed_version
&&
has_changed_repo
else
else
title
=
"Installing
#{
spec
}
"
title
=
"Installing
#{
spec
}
"
end
end
...
...
cocoapods-integration-specs
@
94fd6923
Subproject commit
f7fe19aff17a09075bdba1afcde1d4ffb5fff8ab
Subproject commit
94fd69236ef1f5c92eca020bd7eb4bd5b34138ce
spec/unit/installer_spec.rb
View file @
2acb073e
...
@@ -492,9 +492,13 @@ module Pod
...
@@ -492,9 +492,13 @@ module Pod
it
'prints the previous version of a pod while updating the spec'
do
it
'prints the previous version of a pod while updating the spec'
do
spec
=
Spec
.
new
spec
=
Spec
.
new
spec
.
name
=
'RestKit'
spec
.
name
=
'RestKit'
spec
.
version
=
'2.0'
spec
.
version
=
Version
.
new
(
'2.0'
)
manifest
=
Lockfile
.
new
({})
manifest
=
Lockfile
.
new
(
'SPEC REPOS'
=>
{
'source1'
=>
[
'RestKit'
]
})
manifest
.
stubs
(
:version
).
with
(
'RestKit'
).
returns
(
'1.0'
)
manifest
.
stubs
(
:version
).
with
(
'RestKit'
).
returns
(
Version
.
new
(
'1.0'
))
analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
analysis_result
.
specifications
=
[
spec
]
analysis_result
.
specs_by_source
=
{
Source
.
new
(
'source1'
)
=>
[
spec
]
}
@installer
.
stubs
(
:analysis_result
).
returns
(
analysis_result
)
@installer
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
@installer
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
@installer
.
stubs
(
:root_specs
).
returns
([
spec
])
@installer
.
stubs
(
:root_specs
).
returns
([
spec
])
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
...
@@ -502,9 +506,51 @@ module Pod
...
@@ -502,9 +506,51 @@ module Pod
@installer
.
stubs
(
:sandbox_state
).
returns
(
sandbox_state
)
@installer
.
stubs
(
:sandbox_state
).
returns
(
sandbox_state
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
send
(
:install_pod_sources
)
@installer
.
send
(
:install_pod_sources
)
UI
.
output
.
should
.
not
.
include
'source changed'
UI
.
output
.
should
.
include
'was 1.0'
UI
.
output
.
should
.
include
'was 1.0'
end
end
it
'prints the spec repo of a pod while updating the spec'
do
spec
=
Spec
.
new
spec
.
name
=
'RestKit'
spec
.
version
=
Version
.
new
(
'1.0'
)
manifest
=
Lockfile
.
new
(
'SPEC REPOS'
=>
{
'source1'
=>
[
'RestKit'
]
})
manifest
.
stubs
(
:version
).
with
(
'RestKit'
).
returns
(
Version
.
new
(
'1.0'
))
analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
analysis_result
.
specifications
=
[
spec
]
analysis_result
.
specs_by_source
=
{
Source
.
new
(
'source2'
)
=>
[
spec
]
}
@installer
.
stubs
(
:analysis_result
).
returns
(
analysis_result
)
@installer
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
@installer
.
stubs
(
:root_specs
).
returns
([
spec
])
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
sandbox_state
.
changed
<<
'RestKit'
@installer
.
stubs
(
:sandbox_state
).
returns
(
sandbox_state
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
send
(
:install_pod_sources
)
UI
.
output
.
should
.
not
.
include
'was 1.0'
UI
.
output
.
should
.
include
'source changed to `source2` from `source1`'
end
it
'prints the version and spec repo of a pod while updating the spec'
do
spec
=
Spec
.
new
spec
.
name
=
'RestKit'
spec
.
version
=
Version
.
new
(
'3.0'
)
manifest
=
Lockfile
.
new
(
'SPEC REPOS'
=>
{
'source1'
=>
[
'RestKit'
]
})
manifest
.
stubs
(
:version
).
with
(
'RestKit'
).
returns
(
Version
.
new
(
'2.0'
))
analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
analysis_result
.
specifications
=
[
spec
]
analysis_result
.
specs_by_source
=
{
Source
.
new
(
'source2'
)
=>
[
spec
]
}
@installer
.
stubs
(
:analysis_result
).
returns
(
analysis_result
)
@installer
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
@installer
.
stubs
(
:root_specs
).
returns
([
spec
])
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
sandbox_state
.
changed
<<
'RestKit'
@installer
.
stubs
(
:sandbox_state
).
returns
(
sandbox_state
)
@installer
.
expects
(
:install_source_of_pod
).
with
(
'RestKit'
)
@installer
.
send
(
:install_pod_sources
)
UI
.
output
.
should
.
include
'was 2.0 and source changed to `source2` from `source1`'
end
it
'raises when it attempts to install pod source with no target supporting it'
do
it
'raises when it attempts to install pod source with no target supporting it'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
pod_target
=
PodTarget
.
new
([
spec
],
[
fixture_target_definition
],
config
.
sandbox
)
pod_target
=
PodTarget
.
new
([
spec
],
[
fixture_target_definition
],
config
.
sandbox
)
...
...
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