Commit d08b7f95 authored by Fabio Pelosin's avatar Fabio Pelosin

[Analyzer] Store the sandbox state... well in the sandbox

parent 94b2a315
...@@ -56,7 +56,7 @@ module Pod ...@@ -56,7 +56,7 @@ module Pod
@result.specs_by_target = resolve_dependencies @result.specs_by_target = resolve_dependencies
@result.specifications = generate_specifications @result.specifications = generate_specifications
@result.targets = generate_targets @result.targets = generate_targets
@result.sandbox_state = generate_sandbox_state generate_sandbox_state
@result @result
end end
...@@ -81,7 +81,7 @@ module Pod ...@@ -81,7 +81,7 @@ module Pod
# @return [Bool] Whether the sandbox is in synch with the lockfile. # @return [Bool] Whether the sandbox is in synch with the lockfile.
# #
def sandbox_needs_install?(analysis_result) def sandbox_needs_install?(analysis_result)
state = analysis_result.sandbox_state state = sandbox.state
needing_install = state.added + state.changed + state.deleted needing_install = state.added + state.changed + state.deleted
!needing_install.empty? !needing_install.empty?
end end
...@@ -123,8 +123,8 @@ module Pod ...@@ -123,8 +123,8 @@ module Pod
# the name of the Pod (root name of the dependencies) and doesn't # the name of the Pod (root name of the dependencies) and doesn't
# group them by target definition. # group them by target definition.
# #
# @todo [CocoaPods > 0.18] If there isn't a Lockfile all the Pods should # @todo If Pod changes platform it should be marked as added. This
# be marked as added. # information currently is not stored in the Lockfile.
# #
def generate_podfile_state def generate_podfile_state
if lockfile if lockfile
...@@ -307,6 +307,7 @@ module Pod ...@@ -307,6 +307,7 @@ module Pod
sandbox_state = sandbox_analyzer.analyze sandbox_state = sandbox_analyzer.analyze
sandbox_state.print sandbox_state.print
end end
sandbox.state = sandbox_state
sandbox_state sandbox_state
end end
...@@ -478,11 +479,6 @@ module Pod ...@@ -478,11 +479,6 @@ module Pod
# #
attr_accessor :specifications attr_accessor :specifications
# @return [SpecsState] the states of the {Sandbox} respect the resolved
# specifications.
#
attr_accessor :sandbox_state
# @return [Array<Target>] The Podfile targets containing library # @return [Array<Target>] The Podfile targets containing library
# dependencies. # dependencies.
# #
......
...@@ -78,6 +78,12 @@ module Pod ...@@ -78,6 +78,12 @@ module Pod
Lockfile.from_file(manifest_path) if manifest_path.exist? Lockfile.from_file(manifest_path) if manifest_path.exist?
end end
# @return [Installer::Analyzer::SpecsState] The state of the sandbox
# (added, deleted, changed and unchanged pods) as computed by the
# analyzer.
#
attr_accessor :state
# @return [Project] the Pods project. # @return [Project] the Pods project.
# #
attr_accessor :project attr_accessor :project
......
...@@ -186,8 +186,9 @@ module Pod ...@@ -186,8 +186,9 @@ module Pod
it "computes the state of the Sandbox respect to the resolved dependencies" do it "computes the state of the Sandbox respect to the resolved dependencies" do
@analyzer.stubs(:lockfile).returns(nil) @analyzer.stubs(:lockfile).returns(nil)
state = @analyzer.analyze.sandbox_state @analyzer.analyze
state.added.sort.should == ["AFNetworking", "JSONKit", "SVPullToRefresh", "libextobjc"] added_pods = config.sandbox.state.added.sort
added_pods.should == ["AFNetworking", "JSONKit", "SVPullToRefresh", "libextobjc"]
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