Skip to content

Commit

Permalink
Remove Specification#install! and perform that work from Installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Nov 26, 2011
1 parent d57722f commit 2f29463
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 32 deletions.
13 changes: 12 additions & 1 deletion lib/cocoapods/installer.rb
Expand Up @@ -182,9 +182,20 @@ def target_installers
end.compact
end

def install_dependencies!
build_specifications.each do |spec|
if spec.pod_destroot.exist?
puts "Using #{spec}" unless config.silent?
else
puts "Installing #{spec}" unless config.silent?
spec.download!
end
end
end

def install!
puts "Installing dependencies of: #{@podfile.defined_in_file}" unless config.silent?
build_specifications.each(&:install!)
install_dependencies!
root = config.project_pods_root

puts "==> Generating support files" unless config.silent?
Expand Down
38 changes: 7 additions & 31 deletions lib/cocoapods/specification.rb
Expand Up @@ -333,34 +333,6 @@ def validate!

# Install and download hooks

# Override this if you need to perform work before or after activating the
# pod. Eg:
#
# Pod::Spec.new do |s|
# def s.install!
# # pre-install
# super
# # post-install
# end
# end
#
# TODO Do we really need this now that we don’t install the podspec files anymore?
def install!
puts "==> Installing: #{self}" unless config.silent?
# In case this spec is part of another pod's source, we need to dowload
# the other pod's source.
(part_of_specification || self).download_if_necessary!
end

def download_if_necessary!
if pod_destroot.exist?
puts " * Skipping download of #{self}, pod already downloaded" unless config.silent?
else
puts " * Downloading: #{self}" unless config.silent?
download!
end
end

# Downloads the source of the pod and places it in the project's pods
# directory.
#
Expand All @@ -375,9 +347,13 @@ def download_if_necessary!
# end
# end
def download!
downloader = Downloader.for_source(pod_destroot, source)
downloader.download
downloader.clean(expanded_clean_paths) if config.clean
if spec = part_of_specification
spec.download!
else
downloader = Downloader.for_source(pod_destroot, source)
downloader.download
downloader.clean(expanded_clean_paths) if config.clean
end
end

# This is a convenience method which gets called after all pods have been
Expand Down

0 comments on commit 2f29463

Please sign in to comment.