Commit dec60494 authored by Fabio Pelosin's avatar Fabio Pelosin

[WIP] Installer clean up.

parent 80997638
......@@ -41,9 +41,8 @@ module Pod
def run_install_with_update(update)
sandbox = Sandbox.new(config.project_pods_root)
resolver = Resolver.new(config.podfile, config.lockfile, sandbox)
resolver.update_mode = update
Installer.new(resolver).install!
installer = Installer.new(sandbox, config.podfile, config.lockfile)
installer.install!
end
def run
......
This diff is collapsed.
......@@ -50,8 +50,8 @@ module Pod
end
# @return [Hash{String => Hash}] A hash where the name of the pods are
# the keys and the values are the parameters of an {AbstractExternalSource}
# of the dependency that required the pod.
# the keys and the values are the parameters of an
# {AbstractExternalSource} of the dependency that required the pod.
#
def external_sources
@external_sources ||= to_hash["EXTERNAL SOURCES"] || {}
......@@ -67,8 +67,8 @@ module Pod
end
# @return [Hash{String => Version}] A Hash containing the name
# of the installed Pods as the keys and their corresponding {Version}
# as the values.
# of the installed Pods (top spec name) as the keys and their
# corresponding {Version} as the values.
#
def pods_versions
unless @pods_versions
......@@ -77,6 +77,7 @@ module Pod
pod = pod.keys.first unless pod.is_a?(String)
name, version = name_and_version_for_pod(pod)
@pods_versions[name] = version
@pods_versions[name.split('/').first] = version
end
end
@pods_versions
......
This diff is collapsed.
......@@ -8,30 +8,6 @@ module Pod
end
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
podfile = Podfile.new do
platform :osx
......@@ -39,8 +15,7 @@ module Pod
end
sandbox = Sandbox.new(fixture('integration'))
resolver = Resolver.new(podfile, nil, sandbox)
installer = Installer.new(resolver)
installer = Installer.new(sandbox, podfile)
pods = installer.specifications.map do |spec|
LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform)
end
......@@ -89,6 +64,34 @@ module Pod
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
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