Commit 129cd59f authored by Samuel E. Giddins's avatar Samuel E. Giddins

Warn for deprecated specs on install

parent 72e592d4
......@@ -128,6 +128,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
[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)
......
......@@ -90,6 +90,7 @@ module Pod
download_dependencies
generate_pods_project
integrate_user_project if config.integrate_targets?
perform_post_install_actions
end
def resolve_dependencies
......@@ -286,6 +287,32 @@ module Pod
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.
#
# @return [void]
......
......@@ -52,6 +52,7 @@ module Pod
@installer.stubs(:download_dependencies)
@installer.stubs(:generate_pods_project)
@installer.stubs(:integrate_user_project)
@installer.stubs(:perform_post_install_actions)
end
it "in runs the pre-install hooks before cleaning the Pod sources" do
......@@ -97,6 +98,15 @@ module Pod
@installer.install!
end
it 'prints a list of deprecated pods' do
spec = Spec.new
spec.name = 'RestKit'
spec.deprecated_in_favor_of = 'AFNetworking'
@installer.stubs(:root_specs).returns([spec])
@installer.send(:warn_for_deprecations)
UI.warnings.should.include 'deprecated in favor of AFNetworking'
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