Commit dec60494 authored by Fabio Pelosin's avatar Fabio Pelosin

[WIP] Installer clean up.

parent 80997638
...@@ -41,9 +41,8 @@ module Pod ...@@ -41,9 +41,8 @@ module Pod
def run_install_with_update(update) def run_install_with_update(update)
sandbox = Sandbox.new(config.project_pods_root) sandbox = Sandbox.new(config.project_pods_root)
resolver = Resolver.new(config.podfile, config.lockfile, sandbox) installer = Installer.new(sandbox, config.podfile, config.lockfile)
resolver.update_mode = update installer.install!
Installer.new(resolver).install!
end end
def run def run
......
This diff is collapsed.
...@@ -50,8 +50,8 @@ module Pod ...@@ -50,8 +50,8 @@ module Pod
end end
# @return [Hash{String => Hash}] A hash where the name of the pods are # @return [Hash{String => Hash}] A hash where the name of the pods are
# the keys and the values are the parameters of an {AbstractExternalSource} # the keys and the values are the parameters of an
# of the dependency that required the pod. # {AbstractExternalSource} of the dependency that required the pod.
# #
def external_sources def external_sources
@external_sources ||= to_hash["EXTERNAL SOURCES"] || {} @external_sources ||= to_hash["EXTERNAL SOURCES"] || {}
...@@ -67,8 +67,8 @@ module Pod ...@@ -67,8 +67,8 @@ module Pod
end end
# @return [Hash{String => Version}] A Hash containing the name # @return [Hash{String => Version}] A Hash containing the name
# of the installed Pods as the keys and their corresponding {Version} # of the installed Pods (top spec name) as the keys and their
# as the values. # corresponding {Version} as the values.
# #
def pods_versions def pods_versions
unless @pods_versions unless @pods_versions
...@@ -77,6 +77,7 @@ module Pod ...@@ -77,6 +77,7 @@ module Pod
pod = pod.keys.first unless pod.is_a?(String) pod = pod.keys.first unless pod.is_a?(String)
name, version = name_and_version_for_pod(pod) name, version = name_and_version_for_pod(pod)
@pods_versions[name] = version @pods_versions[name] = version
@pods_versions[name.split('/').first] = version
end end
end end
@pods_versions @pods_versions
......
This diff is collapsed.
...@@ -8,30 +8,6 @@ module Pod ...@@ -8,30 +8,6 @@ module Pod
end end
describe "by default" do describe "by default" do
before do
podfile = Podfile.new do
platform :ios
xcodeproj 'MyProject'
pod 'JSONKit'
end
sandbox = Sandbox.new(fixture('integration'))
resolver = Resolver.new(podfile, nil, sandbox)
@xcconfig = Installer.new(resolver).target_installers.first.xcconfig.to_hash
end
it "sets the header search paths where installed Pod headers can be found" do
@xcconfig['ALWAYS_SEARCH_USER_PATHS'].should == 'YES'
end
it "configures the project to load all members that implement Objective-c classes or categories from the static library" do
@xcconfig['OTHER_LDFLAGS'].should == '-ObjC'
end
it "sets the PODS_ROOT build variable" do
@xcconfig['PODS_ROOT'].should.not == nil
end
it "generates a BridgeSupport metadata file from all the pod headers" do it "generates a BridgeSupport metadata file from all the pod headers" do
podfile = Podfile.new do podfile = Podfile.new do
platform :osx platform :osx
...@@ -39,8 +15,7 @@ module Pod ...@@ -39,8 +15,7 @@ module Pod
end end
sandbox = Sandbox.new(fixture('integration')) sandbox = Sandbox.new(fixture('integration'))
resolver = Resolver.new(podfile, nil, sandbox) installer = Installer.new(sandbox, podfile)
installer = Installer.new(resolver)
pods = installer.specifications.map do |spec| pods = installer.specifications.map do |spec|
LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform) LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform)
end end
...@@ -89,6 +64,34 @@ module Pod ...@@ -89,6 +64,34 @@ module Pod
end end
end end
describe "concerning xcconfig files generation" do
before do
podfile = Podfile.new do
platform :ios
xcodeproj 'MyProject'
pod 'JSONKit'
end
sandbox = Sandbox.new(fixture('integration'))
installer = Installer.new(sandbox, podfile)
@xcconfig = installer.target_installers.first.xcconfig.to_hash
end
it "sets the header search paths where installed Pod headers can be found" do
@xcconfig['ALWAYS_SEARCH_USER_PATHS'].should == 'YES'
end
it "configures the project to load all members that implement Objective-c classes or categories from the static library" do
@xcconfig['OTHER_LDFLAGS'].should == '-ObjC'
end
it "sets the PODS_ROOT build variable" do
@xcconfig['PODS_ROOT'].should.not == nil
end
end
describe "concerning multiple pods originating form the same spec" do describe "concerning multiple pods originating form the same spec" do
extend SpecHelper::Fixture extend SpecHelper::Fixture
......
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