Commit fcc94b68 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Don't generate documenation if already installed

It checks that the documenation exist for a given version of a pod
and in that case it doesn't generate it again.
parent 5210cffc
...@@ -74,6 +74,10 @@ module Pod ...@@ -74,6 +74,10 @@ module Pod
options += spec_appledoc_options options += spec_appledoc_options
end end
def already_installed?
Pathname.new(File.expand_path("~/Library/Developer/Shared/Documentation/DocSets/org.cocoapods.#{name.gsub(/ /,'-')}.docset")).exist?
end
def generate(install = false) def generate(install = false)
options = appledoc_options options = appledoc_options
options += ['--output', @target_path.to_s] options += ['--output', @target_path.to_s]
......
...@@ -60,8 +60,13 @@ module Pod ...@@ -60,8 +60,13 @@ module Pod
end end
if (should_install && config.generate_docs?) || config.force_doc? if (should_install && config.generate_docs?) || config.force_doc?
puts "Installing Documentation for #{pod.specification}".green if config.verbose? doc_generator = Generator::Documentation.new(pod)
Generator::Documentation.new(pod).generate(config.doc_install?) if doc_generator.already_installed?
puts "Using Existing Documentation for #{pod.specification}".green if config.verbose?
else
puts "Installing Documentation for #{pod.specification}".green if config.verbose?
doc_generator.generate(config.doc_install?)
end
end end
end end
end end
......
...@@ -208,6 +208,8 @@ else ...@@ -208,6 +208,8 @@ else
dependency 'SSToolkit' dependency 'SSToolkit'
end end
Pod::Generator::Documentation.any_instance.stubs(:already_installed?).returns(false)
installer = SpecHelper::Installer.new(podfile) installer = SpecHelper::Installer.new(podfile)
installer.install! installer.install!
......
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