Commit 40db4498 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Improve UI

parent 943ea72d
...@@ -85,11 +85,7 @@ module Pod ...@@ -85,11 +85,7 @@ module Pod
download_dependencies download_dependencies
generate_pods_project generate_pods_project
if config.integrate_targets? integrate_user_project if config.integrate_targets?
UI.section "Integrating client projects" do
integrate_user_project
end
end
end end
def resolve_dependencies def resolve_dependencies
...@@ -97,7 +93,7 @@ module Pod ...@@ -97,7 +93,7 @@ module Pod
analyze analyze
detect_pods_to_install detect_pods_to_install
prepare_for_legacy_compatibility prepare_for_legacy_compatibility
prepare_sandbox clean_sandbox
end end
end end
...@@ -109,7 +105,7 @@ module Pod ...@@ -109,7 +105,7 @@ module Pod
end end
def generate_pods_project def generate_pods_project
UI.section "Generating pods project" do UI.section "Generating Pods project" do
prepare_pods_project prepare_pods_project
run_pre_install_hooks run_pre_install_hooks
install_file_references install_file_references
...@@ -222,16 +218,15 @@ module Pod ...@@ -222,16 +218,15 @@ module Pod
# @todo Clean the podspecs of all the pods that aren't unchanged so the # @todo Clean the podspecs of all the pods that aren't unchanged so the
# resolution process doesn't get confused by them. # resolution process doesn't get confused by them.
# #
def prepare_sandbox def clean_sandbox
sandbox.build_headers.implode! sandbox.build_headers.implode!
sandbox.public_headers.implode! sandbox.public_headers.implode!
unless analysis_result.sandbox_state.deleted.empty? unless analysis_result.sandbox_state.deleted.empty?
UI.section "Removing deleted dependencies" do title_options = { :verbose_prefix => "-> ".red }
analysis_result.sandbox_state.deleted.each do |pod_name| analysis_result.sandbox_state.deleted.each do |pod_name|
UI.section("Removing #{pod_name}", "-> ".red) do UI.titled_section("Removing #{pod_name}".red, title_options) do
sandbox.clean_pod(pod_name) sandbox.clean_pod(pod_name)
end
end end
end end
end end
...@@ -263,13 +258,14 @@ module Pod ...@@ -263,13 +258,14 @@ module Pod
# #
def install_pod_sources def install_pod_sources
@installed_specs = [] @installed_specs = []
title_options = { :verbose_prefix => "-> ".green }
root_specs.each do |spec| root_specs.each do |spec|
if names_of_pods_to_install.include?(spec.name) if names_of_pods_to_install.include?(spec.name)
UI.section("Installing #{spec}".green, "-> ".green) do UI.titled_section("Installing #{spec}".green, title_options) do
install_source_of_pod(spec.name) install_source_of_pod(spec.name)
end end
else else
UI.section("Using #{spec}", "-> ".green) UI.titled_section("Using #{spec}", title_options)
end end
end end
end end
...@@ -386,9 +382,11 @@ module Pod ...@@ -386,9 +382,11 @@ module Pod
# information in the lockfile. # information in the lockfile.
# #
def integrate_user_project def integrate_user_project
installation_root = config.installation_root UI.section "Integrating client projects" do
integrator = UserProjectIntegrator.new(podfile, sandbox, installation_root, libraries) installation_root = config.installation_root
integrator.integrate! integrator = UserProjectIntegrator.new(podfile, sandbox, installation_root, libraries)
integrator.integrate!
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -122,7 +122,7 @@ module Pod ...@@ -122,7 +122,7 @@ module Pod
def generate_podfile_state def generate_podfile_state
if lockfile if lockfile
pods_state = nil pods_state = nil
UI.section "Finding Podfile changes:" do UI.section "Finding Podfile changes" do
pods_by_state = lockfile.detect_changes_with_podfile(podfile) pods_by_state = lockfile.detect_changes_with_podfile(podfile)
pods_by_state.dup.each do |state, full_names| pods_by_state.dup.each do |state, full_names|
pods_by_state[state] = full_names.map { |fn| Specification.root_name(fn) } pods_by_state[state] = full_names.map { |fn| Specification.root_name(fn) }
...@@ -294,7 +294,7 @@ module Pod ...@@ -294,7 +294,7 @@ module Pod
sandbox_lockfile = sandbox.manifest || lockfile sandbox_lockfile = sandbox.manifest || lockfile
sandbox_state = SpecsState.new sandbox_state = SpecsState.new
UI.section "Comparing resolved specification to the sandbox manifest:" do UI.section "Comparing resolved specification to the sandbox manifest" do
resolved_subspecs_names = result.specifications.group_by { |s| s.root.name } resolved_subspecs_names = result.specifications.group_by { |s| s.root.name }
resolved_names = resolved_subspecs_names.keys resolved_names = resolved_subspecs_names.keys
......
...@@ -45,6 +45,27 @@ module Pod ...@@ -45,6 +45,27 @@ module Pod
self.title_level -= 1 self.title_level -= 1
end end
# In verbose mode it shows the sections and the contents.
# In normal mode it just prints the title.
#
# @return [void]
#
def titled_section(title, options = {})
relative_indentation = options[:relative_indentation] || 0
verbose_prefix = options[:verbose_prefix] || ''
if config.verbose?
title(title, verbose_prefix, relative_indentation)
else
puts title
end
self.indentation_level += relative_indentation
self.title_level += 1
yield if block_given?
self.indentation_level -= relative_indentation
self.title_level -= 1
end
# A title opposed to a section is always visible # A title opposed to a section is always visible
# #
def title(title, verbose_prefix = '', relative_indentation = 2) def title(title, verbose_prefix = '', relative_indentation = 2)
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Finding Podfile changes: Resolving dependencies
Finding Podfile changes
A JSONKit A JSONKit
- Reachability - Reachability
Resolving dependencies of `Podfile` Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
- JSONKit (= 1.5pre) - JSONKit (= 1.5pre)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A JSONKit A JSONKit
- Reachability - Reachability
...@@ -32,7 +33,7 @@ Downloading dependencies ...@@ -32,7 +33,7 @@ Downloading dependencies
-> Using Reachability (3.1.0) -> Using Reachability (3.1.0)
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 4.3) Resolving dependencies for target `default' (iOS 4.3)
- PodTest (from `PodTest-hg-source`) - PodTest (from `PodTest-hg-source`)
-> Pre-downloading: `PodTest` -> Pre-downloading: `PodTest`
...@@ -11,14 +12,14 @@ Resolving dependencies for target `default' (iOS 4.3) ...@@ -11,14 +12,14 @@ Resolving dependencies for target `default' (iOS 4.3)
- PodTest/subspec_1 (= 1.0) - PodTest/subspec_1 (= 1.0)
- PodTest/subspec_2 (= 1.0) - PodTest/subspec_2 (= 1.0)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A PodTest A PodTest
Downloading dependencies Downloading dependencies
-> Installing PodTest (1.0) -> Installing PodTest (1.0)
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 4.3) Resolving dependencies for target `default' (iOS 4.3)
- Reachability (from `Reachability`) - Reachability (from `Reachability`)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
Downloading dependencies Downloading dependencies
-> Installing Reachability (3.1.0) -> Installing Reachability (3.1.0)
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
Resolving dependencies for target `test' (iOS 6.0) Resolving dependencies for target `test' (iOS 6.0)
- JSONKit - JSONKit
Resolving dependencies for target `SampleApp_2' (iOS 6.0) Resolving dependencies for target `SampleApp_2' (iOS 6.0)
- JSONKit - JSONKit
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
A JSONKit A JSONKit
...@@ -52,7 +51,7 @@ Downloading dependencies ...@@ -52,7 +51,7 @@ Downloading dependencies
$ /usr/bin/git checkout -b activated-pod-commit 0aff3deb5e1bb2bbc88a83fd71c8ad5550185cce 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 0aff3deb5e1bb2bbc88a83fd71c8ad5550185cce 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
Downloading dependencies Downloading dependencies
...@@ -29,7 +30,7 @@ Downloading dependencies ...@@ -29,7 +30,7 @@ Downloading dependencies
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
Downloading dependencies Downloading dependencies
...@@ -29,7 +30,7 @@ Downloading dependencies ...@@ -29,7 +30,7 @@ Downloading dependencies
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Podfile - Podfile
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (from `Reachability.podspec`) - Reachability (from `Reachability.podspec`)
-> Fetching podspec for `Reachability` from: Reachability.podspec -> Fetching podspec for `Reachability` from: Reachability.podspec
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
Downloading dependencies Downloading dependencies
...@@ -30,7 +31,7 @@ Downloading dependencies ...@@ -30,7 +31,7 @@ Downloading dependencies
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Finding Podfile changes: Resolving dependencies
Finding Podfile changes
R JSONKit R JSONKit
- Reachability - Reachability
Resolving dependencies of `Podfile` Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (= 3.1.0) - Reachability (= 3.1.0)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
R JSONKit R JSONKit
- Reachability - Reachability
Removing deleted dependencies
-> Removing JSONKit -> Removing JSONKit
Downloading dependencies Downloading dependencies
-> Using Reachability (3.1.0) -> Using Reachability (3.1.0)
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.0) Resolving dependencies for target `default' (iOS 6.0)
- Reachability (from `Reachability.podspec`) - Reachability (from `Reachability.podspec`)
-> Fetching podspec for `Reachability` from: Reachability.podspec -> Fetching podspec for `Reachability` from: Reachability.podspec
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A Reachability A Reachability
Downloading dependencies Downloading dependencies
...@@ -30,7 +31,7 @@ Downloading dependencies ...@@ -30,7 +31,7 @@ Downloading dependencies
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Reachability - Reachability
......
$ pod install --no-update --no-doc --verbose --no-color $ pod install --no-update --no-doc --verbose --no-color
Resolving dependencies of `Podfile` Resolving dependencies
Resolving dependencies of `Podfile`
Resolving dependencies for target `default' (iOS 6.1) Resolving dependencies for target `default' (iOS 6.1)
Resolving dependencies for target `iOS App' (iOS 4.3) Resolving dependencies for target `iOS App' (iOS 4.3)
- PodTest/subspec_1 (from `PodTest-hg-source`) - PodTest/subspec_1 (from `PodTest-hg-source`)
-> Pre-downloading: `PodTest` -> Pre-downloading: `PodTest`
...@@ -10,18 +10,17 @@ Resolving dependencies for target `iOS App' (iOS 4.3) ...@@ -10,18 +10,17 @@ Resolving dependencies for target `iOS App' (iOS 4.3)
$ /usr/local/bin/hg clone "PodTest-hg-source" "ROOT/tmp/install_subspecs/Pods/PodTest" $ /usr/local/bin/hg clone "PodTest-hg-source" "ROOT/tmp/install_subspecs/Pods/PodTest"
updating to branch default updating to branch default
5 files updated, 0 files merged, 0 files removed, 0 files unresolved 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
Resolving dependencies for target `OS X App' (OS X 10.6) Resolving dependencies for target `OS X App' (OS X 10.6)
- PodTest/subspec_2 (from `PodTest-hg-source`) - PodTest/subspec_2 (from `PodTest-hg-source`)
Comparing resolved specification to the sandbox manifest: Comparing resolved specification to the sandbox manifest
A PodTest A PodTest
Downloading dependencies Downloading dependencies
-> Installing PodTest (1.0) -> Installing PodTest (1.0)
Generating Pods Project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks - Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
......
...@@ -188,7 +188,7 @@ module Pod ...@@ -188,7 +188,7 @@ module Pod
#--------------------------------------# #--------------------------------------#
describe "#prepare_sandbox" do describe "#clean_sandbox" do
before do before do
@analysis_result = Installer::Analyzer::AnalysisResult.new @analysis_result = Installer::Analyzer::AnalysisResult.new
...@@ -200,13 +200,13 @@ module Pod ...@@ -200,13 +200,13 @@ module Pod
it "cleans the header stores" do it "cleans the header stores" do
config.sandbox.build_headers.expects(:implode!) config.sandbox.build_headers.expects(:implode!)
config.sandbox.public_headers.expects(:implode!) config.sandbox.public_headers.expects(:implode!)
@installer.send(:prepare_sandbox) @installer.send(:clean_sandbox)
end end
it "deletes the sources of the removed Pods" do it "deletes the sources of the removed Pods" do
@analysis_result.sandbox_state.add_name('Deleted-Pod', :deleted) @analysis_result.sandbox_state.add_name('Deleted-Pod', :deleted)
config.sandbox.expects(:clean_pod).with('Deleted-Pod') config.sandbox.expects(:clean_pod).with('Deleted-Pod')
@installer.send(:prepare_sandbox) @installer.send(:clean_sandbox)
end 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