Commit aa4ce7e2 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'segiddins-warn-for-deprecated-specs-on-install'

* segiddins-warn-for-deprecated-specs-on-install:
  [InstallerSpec] Check for deprecation message when spec.deprecated = true
  Warn for deprecated specs on install
parents 9c4488d9 e302da39
...@@ -131,6 +131,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -131,6 +131,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
* Warn when including deprecated pods
[Samuel E. Giddins](https://github.com/segiddins)
[#2003](https://github.com/CocoaPods/CocoaPods/issues/2003)
## 0.31.1 ## 0.31.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.31.1...0.31.0) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.31.1...0.31.0)
[CocoaPods-Core](https://github.com/CocoaPods/Core/compare/0.31.1...0.31.0) [CocoaPods-Core](https://github.com/CocoaPods/Core/compare/0.31.1...0.31.0)
......
...@@ -90,6 +90,7 @@ module Pod ...@@ -90,6 +90,7 @@ module Pod
download_dependencies download_dependencies
generate_pods_project generate_pods_project
integrate_user_project if config.integrate_targets? integrate_user_project if config.integrate_targets?
perform_post_install_actions
end end
def resolve_dependencies def resolve_dependencies
...@@ -286,6 +287,32 @@ module Pod ...@@ -286,6 +287,32 @@ module Pod
end end
end end
# Performs any post-installation actions
#
# @return [void]
#
def perform_post_install_actions
warn_for_deprecations
end
# Prints a warning for any pods that are deprecated
#
# @return [void]
#
def warn_for_deprecations
deprecated_pods = root_specs.select do |spec|
spec.deprecated || spec.deprecated_in_favor_of
end
deprecated_pods.each do |spec|
if spec.deprecated_in_favor_of
UI.warn "#{spec.name} has been deprecated in " \
"favor of #{spec.deprecated_in_favor_of}"
else
UI.warn "#{spec.name} has been deprecated"
end
end
end
# Creates the Pods project from scratch if it doesn't exists. # Creates the Pods project from scratch if it doesn't exists.
# #
# @return [void] # @return [void]
......
...@@ -52,6 +52,7 @@ module Pod ...@@ -52,6 +52,7 @@ module Pod
@installer.stubs(:download_dependencies) @installer.stubs(:download_dependencies)
@installer.stubs(:generate_pods_project) @installer.stubs(:generate_pods_project)
@installer.stubs(:integrate_user_project) @installer.stubs(:integrate_user_project)
@installer.stubs(:perform_post_install_actions)
end end
it "in runs the pre-install hooks before cleaning the Pod sources" do it "in runs the pre-install hooks before cleaning the Pod sources" do
...@@ -97,6 +98,19 @@ module Pod ...@@ -97,6 +98,19 @@ module Pod
@installer.install! @installer.install!
end end
it 'prints a list of deprecated pods' do
spec = Spec.new
spec.name = 'RestKit'
spec.deprecated_in_favor_of = 'AFNetworking'
spec_two = Spec.new
spec_two.name = 'BlocksKit'
spec_two.deprecated = true
@installer.stubs(:root_specs).returns([spec, spec_two])
@installer.send(:warn_for_deprecations)
UI.warnings.should.include 'deprecated in favor of AFNetworking'
UI.warnings.should.include 'BlocksKit has been deprecated'
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment