Commit 1f5d4f0e authored by Fabio Pelosin's avatar Fabio Pelosin

[Xcodeproj][Project] Remove build configurations from initialization

parent 4dcef288
......@@ -17,7 +17,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: b1878be0ea3e2f212a2f61be089c757d13b637db
revision: 5f0fc07355716817b7591a859774a93f6773d559
branch: paths-refactor
specs:
xcodeproj (0.9.0)
......
......@@ -285,7 +285,10 @@ module Pod
#
def prepare_pods_project
UI.message "- Creating Pods project" do
@pods_project = Pod::Project.new(sandbox, analysis_result.all_user_build_configurations)
@pods_project = Pod::Project.new(sandbox)
analysis_result.all_user_build_configurations.each do |name, type|
@pods_project.add_build_configuration(name, type)
end
if config.podfile_path
@pods_project.add_podfile(config.podfile_path)
end
......
......@@ -17,8 +17,8 @@ module Pod
# @param [Sandbox] sandbox @see #sandbox
#
def initialize(sandbox, build_configurations)
super(sandbox.project_path, build_configurations) # Recreate the project from scratch for now.
def initialize(sandbox)
super(sandbox.project_path) # Recreate the project from scratch for now.
# TODO
raise unless sandbox.is_a?(Sandbox)
@sandbox = sandbox
......
......@@ -7,7 +7,7 @@ module Pod
@file_accessor = fixture_file_accessor('banana-lib/BananaLib.podspec')
@pod_target = PodTarget.new([], nil, config.sandbox)
@pod_target.file_accessors = [@file_accessor]
@project = Project.new(config.sandbox, nil)
@project = Project.new(config.sandbox)
@installer = Installer::FileReferencesInstaller.new(config.sandbox, [@pod_target], @project)
end
......
......@@ -9,7 +9,7 @@ module Pod
xcodeproj 'dummy'
end
@target_definition = @podfile.target_definitions['Pods']
@project = Project.new(config.sandbox, nil)
@project = Project.new(config.sandbox)
config.sandbox.project = @project
path_list = Sandbox::PathList.new(fixture('banana-lib'))
......
......@@ -9,8 +9,7 @@ module Pod
xcodeproj 'dummy'
end
@target_definition = @podfile.target_definitions['Pods']
user_build_configurations = { 'Debug' => :debug, 'Release' => :release, 'AppStore' => :release, 'Test' => :debug }
@project = Project.new(config.sandbox, user_build_configurations)
@project = Project.new(config.sandbox)
config.sandbox.project = @project
path_list = Sandbox::PathList.new(fixture('banana-lib'))
......@@ -20,9 +19,8 @@ module Pod
@pod_target = PodTarget.new([@spec], @target_definition, config.sandbox)
@pod_target.stubs(:platform).returns(Platform.new(:ios, '6.0'))
@pod_target.user_build_configurations = user_build_configurations
@pod_target.file_accessors = [file_accessor]
@pod_target.user_build_configurations = { 'Debug' => :debug, 'Release' => :release }
@installer = Installer::PodTargetInstaller.new(config.sandbox, @pod_target)
@spec.prefix_header_contents = '#import "BlocksKit.h"'
......@@ -48,13 +46,6 @@ module Pod
@project.targets.first.name.should == 'Pods-BananaLib'
end
it "adds the user build configurations to the target" do
@installer.install!
target = @project.targets.first
target.build_settings('Test')["VALIDATE_PRODUCT"].should == nil
target.build_settings('AppStore')["VALIDATE_PRODUCT"].should == "YES"
end
it "sets VALIDATE_PRODUCT to YES for the Release configuration for iOS targets" do
@installer.install!
target = @project.targets.first
......@@ -67,7 +58,6 @@ module Pod
target.platform_name.should == :ios
target.deployment_target.should == "6.0"
target.build_settings('Debug')["IPHONEOS_DEPLOYMENT_TARGET"].should == "6.0"
target.build_settings('AppStore')["IPHONEOS_DEPLOYMENT_TARGET"].should == "6.0"
end
it "sets the platform and the deployment target for OS X targets" do
......@@ -77,10 +67,10 @@ module Pod
target.platform_name.should == :osx
target.deployment_target.should == "10.8"
target.build_settings('Debug')["MACOSX_DEPLOYMENT_TARGET"].should == "10.8"
target.build_settings('AppStore')["MACOSX_DEPLOYMENT_TARGET"].should == "10.8"
end
it "adds the user's build configurations to the target" do
@pod_target.user_build_configurations.merge!({ 'AppStore' => :release, 'Test' => :debug })
@installer.install!
@project.targets.first.build_configurations.map(&:name).sort.should == %w{ AppStore Debug Release Test }
end
......@@ -88,7 +78,7 @@ module Pod
it "it creates different hash instances for the build settings of various build configurations" do
@installer.install!
build_settings = @project.targets.first.build_configurations.map(&:build_settings)
build_settings.map(&:object_id).uniq.count.should == 4
build_settings.map(&:object_id).uniq.count.should == 2
end
it "does not enable the GCC_WARN_INHIBIT_ALL_WARNINGS flag by default" do
......
......@@ -9,7 +9,7 @@ module Pod
xcodeproj 'dummy'
end
@target_definition = @podfile.target_definitions['Pods']
@project = Project.new(config.sandbox, nil)
@project = Project.new(config.sandbox)
config.sandbox.project = @project
path_list = Sandbox::PathList.new(fixture('banana-lib'))
......
......@@ -16,7 +16,7 @@ module Pod
end
end
config.sandbox.project = Project.new(config.sandbox, nil)
config.sandbox.project = Project.new(config.sandbox)
Xcodeproj::Project.new(config.sandbox.project_path).save
@library = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox)
@library.client_root = sample_project_path.dirname
......
......@@ -4,7 +4,7 @@ module Pod
describe Project do
before do
@project = Project.new(config.sandbox, nil)
@project = Project.new(config.sandbox)
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