Commit 5b30b397 authored by Eloy Durán's avatar Eloy Durán

[Installer] Add all the user's build configurations to the Pods project.

parent d791a305
...@@ -285,7 +285,7 @@ module Pod ...@@ -285,7 +285,7 @@ module Pod
# #
def prepare_pods_project def prepare_pods_project
UI.message "- Creating Pods project" do UI.message "- Creating Pods project" do
@pods_project = Pod::Project.new(sandbox, @podfile.target_definitions['Pods'].build_configurations) @pods_project = Pod::Project.new(sandbox, analysis_result.all_user_build_configurations)
if config.podfile_path if config.podfile_path
@pods_project.add_podfile(config.podfile_path) @pods_project.add_podfile(config.podfile_path)
end end
......
...@@ -16,7 +16,7 @@ end ...@@ -16,7 +16,7 @@ end
def generate_podfile(pods = ['JSONKit']) def generate_podfile(pods = ['JSONKit'])
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
platform :ios platform :ios
xcodeproj 'SampleProject/SampleProject', 'Debug' => :debug, 'Test' => :debug, 'Release' => :release, 'App Store' => :release xcodeproj SpecHelper.fixture('SampleProject/SampleProject'), 'Test' => :debug, 'App Store' => :release
pods.each { |name| pod name } pods.each { |name| pod name }
end end
end end
...@@ -112,7 +112,7 @@ module Pod ...@@ -112,7 +112,7 @@ module Pod
@installer.pod_targets.map(&:name).sort.should == ['Pods-JSONKit'] @installer.pod_targets.map(&:name).sort.should == ['Pods-JSONKit']
end end
it "configures the analizer to use update mode if appropriate" do it "configures the analyzer to use update mode if appropriate" do
@installer.update_mode = true @installer.update_mode = true
Installer::Analyzer.any_instance.expects(:update_mode=).with(true) Installer::Analyzer.any_instance.expects(:update_mode=).with(true)
@installer.send(:analyze) @installer.send(:analyze)
...@@ -217,14 +217,37 @@ module Pod ...@@ -217,14 +217,37 @@ module Pod
describe "#prepare_pods_project" do describe "#prepare_pods_project" do
it "creates the Pods project" do before do
@installer.stubs(:aggregate_targets).returns([]) @installer.stubs(:aggregate_targets).returns([])
end
it "creates build configurations for all of the user's targets" do
config.integrate_targets = true
@installer.send(:analyze)
@installer.send(:prepare_pods_project)
@installer.pods_project.build_configurations.map(&:name).sort.should == ['App Store', 'Debug', 'Release', 'Test']
end
it "sets STRIP_INSTALLED_PRODUCT to NO for all configurations for the whole project" do
config.integrate_targets = true
@installer.send(:analyze)
@installer.send(:prepare_pods_project)
@installer.pods_project.build_settings('Debug')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('Test')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('Release')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('App Store')["STRIP_INSTALLED_PRODUCT"].should == "NO"
end
before do
@installer.stubs(:analysis_result).returns(stub(:all_user_build_configurations => {}))
end
it "creates the Pods project" do
@installer.send(:prepare_pods_project) @installer.send(:prepare_pods_project)
@installer.pods_project.class.should == Pod::Project @installer.pods_project.class.should == Pod::Project
end end
it "adds the Podfile to the Pods project" do it "adds the Podfile to the Pods project" do
@installer.stubs(:aggregate_targets).returns([])
config.stubs(:podfile_path).returns(Pathname.new('/Podfile')) config.stubs(:podfile_path).returns(Pathname.new('/Podfile'))
@installer.send(:prepare_pods_project) @installer.send(:prepare_pods_project)
@installer.pods_project['Podfile'].should.be.not.nil @installer.pods_project['Podfile'].should.be.not.nil
...@@ -244,14 +267,6 @@ module Pod ...@@ -244,14 +267,6 @@ module Pod
end end
end end
it "sets STRIP_INSTALLED_PRODUCT to NO for all configurations for the whole project" do
@installer.stubs(:aggregate_targets).returns([])
@installer.send(:prepare_pods_project)
@installer.pods_project.build_settings('Debug')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('Test')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('Release')["STRIP_INSTALLED_PRODUCT"].should == "NO"
@installer.pods_project.build_settings('App Store')["STRIP_INSTALLED_PRODUCT"].should == "NO"
end
end end
#--------------------------------------# #--------------------------------------#
...@@ -317,6 +332,7 @@ module Pod ...@@ -317,6 +332,7 @@ module Pod
before do before do
@installer.stubs(:aggregate_targets).returns([]) @installer.stubs(:aggregate_targets).returns([])
@installer.stubs(:analysis_result).returns(stub(:all_user_build_configurations => {}))
@installer.send(:prepare_pods_project) @installer.send(:prepare_pods_project)
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