Commit c06de172 authored by Fabio Pelosin's avatar Fabio Pelosin

[Xcodeproj] Rename Project::save_as

parent 3a9f5197
...@@ -17,7 +17,7 @@ GIT ...@@ -17,7 +17,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 00c89436cd64b9e26db60fcf8ca99dbd62b01b58 revision: 230cd26ab0c73c70e6017458a8eea920e5f76233
branch: paths-refactor branch: paths-refactor
specs: specs:
xcodeproj (0.9.0) xcodeproj (0.9.0)
......
...@@ -377,7 +377,7 @@ module Pod ...@@ -377,7 +377,7 @@ module Pod
UI.message "- Writing Xcode project file to #{UI.path sandbox.project_path}" do UI.message "- Writing Xcode project file to #{UI.path sandbox.project_path}" do
pods_project.main_group.sort_by_type! pods_project.main_group.sort_by_type!
pods_project['Frameworks'].sort_by_type! pods_project['Frameworks'].sort_by_type!
pods_project.save_as(sandbox.project_path) pods_project.save
end end
end end
......
...@@ -32,7 +32,7 @@ module Pod ...@@ -32,7 +32,7 @@ module Pod
add_pods_library add_pods_library
add_copy_resources_script_phase add_copy_resources_script_phase
add_check_manifest_lock_script_phase add_check_manifest_lock_script_phase
save_user_project user_project.save
end end
end end
...@@ -182,14 +182,6 @@ module Pod ...@@ -182,14 +182,6 @@ module Pod
end end
end end
# Saves the changes to the user project to the disk.
#
# @return [void]
#
def save_user_project
user_project.save_as(target.user_project_path)
end
#---------------------------------------------------------------------# #---------------------------------------------------------------------#
# @!group Private helpers. # @!group Private helpers.
......
...@@ -17,8 +17,8 @@ module Pod ...@@ -17,8 +17,8 @@ module Pod
it "complains if more than one project exists and none is specified" do it "complains if more than one project exists and none is specified" do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test2.xcodeproj').save
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test2.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
lambda { run_command('init') }.should.raise Informative lambda { run_command('init') }.should.raise Informative
end end
end end
...@@ -26,14 +26,14 @@ module Pod ...@@ -26,14 +26,14 @@ module Pod
it "complains if a Podfile already exists" do it "complains if a Podfile already exists" do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
(Pathname.pwd + 'Podfile').open('w') { |f| f << "pod 'AFNetworking'" } (Pathname.pwd + 'Podfile').open('w') { |f| f << "pod 'AFNetworking'" }
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
lambda { run_command('init') }.should.raise Informative lambda { run_command('init') }.should.raise Informative
end end
end end
it "creates a Podfile for a project in current directory" do it "creates a Podfile for a project in current directory" do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
run_command('init') run_command('init')
Pathname.new(temporary_directory + 'Podfile').exist?.should == true Pathname.new(temporary_directory + 'Podfile').exist?.should == true
end end
...@@ -41,8 +41,8 @@ module Pod ...@@ -41,8 +41,8 @@ module Pod
it "creates a Podfile for a specified project" do it "creates a Podfile for a specified project" do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test1.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test1.xcodeproj').save
Xcodeproj::Project.new('path').save_as(temporary_directory + 'test2.xcodeproj') Xcodeproj::Project.new(temporary_directory + 'test2.xcodeproj').save
run_command('init', 'test2.xcodeproj') run_command('init', 'test2.xcodeproj')
Pathname.new(temporary_directory + 'Podfile').exist?.should == true Pathname.new(temporary_directory + 'Podfile').exist?.should == true
config.podfile.nil?.should == false config.podfile.nil?.should == false
...@@ -51,10 +51,10 @@ module Pod ...@@ -51,10 +51,10 @@ module Pod
it "creates a Podfile with targets from the project" do it "creates a Podfile with targets from the project" do
Dir.chdir(temporary_directory) do Dir.chdir(temporary_directory) do
project = Xcodeproj::Project.new('path') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
target1 = project.new_target(:application, "AppA", :ios) target1 = project.new_target(:application, "AppA", :ios)
target2 = project.new_target(:application, "AppB", :ios) target2 = project.new_target(:application, "AppB", :ios)
project.save_as(temporary_directory + 'test.xcodeproj') project.save
run_command('init') run_command('init')
...@@ -73,9 +73,9 @@ module Pod ...@@ -73,9 +73,9 @@ module Pod
open(config.default_podfile_path, 'w') { |f| f << "pod 'AFNetworking'" } open(config.default_podfile_path, 'w') { |f| f << "pod 'AFNetworking'" }
project = Xcodeproj::Project.new('path') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, 'AppA', :ios) project.new_target(:application, 'AppA', :ios)
project.save_as(temporary_directory + 'test.xcodeproj') project.save
run_command('init') run_command('init')
...@@ -92,9 +92,9 @@ module Pod ...@@ -92,9 +92,9 @@ module Pod
open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" } open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" }
project = Xcodeproj::Project.new('path') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, "AppTests", :ios) project.new_target(:application, "AppTests", :ios)
project.save_as(temporary_directory + 'test.xcodeproj') project.save
run_command('init') run_command('init')
...@@ -111,9 +111,9 @@ module Pod ...@@ -111,9 +111,9 @@ module Pod
open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" } open(config.default_test_podfile_path, 'w') { |f| f << "pod 'Kiwi'" }
project = Xcodeproj::Project.new('path') project = Xcodeproj::Project.new(temporary_directory + 'test.xcodeproj')
project.new_target(:application, "App", :ios) project.new_target(:application, "App", :ios)
project.save_as(temporary_directory + 'test.xcodeproj') project.save
run_command('init') run_command('init')
......
...@@ -13,7 +13,7 @@ module Pod ...@@ -13,7 +13,7 @@ module Pod
before do before do
sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject') sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
@sample_project = Xcodeproj::Project.open(sample_project_path) @sample_project = Xcodeproj::Project.open(sample_project_path)
Xcodeproj::Project.new('path').save_as(config.sandbox.project_path) Xcodeproj::Project.new(config.sandbox.project_path).save
@target = @sample_project.targets.first @target = @sample_project.targets.first
target_definition = Podfile::TargetDefinition.new('Pods', nil) target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.link_with_first_target = true target_definition.link_with_first_target = true
......
...@@ -17,7 +17,7 @@ module Pod ...@@ -17,7 +17,7 @@ module Pod
end end
end end
config.sandbox.project = Project.new(config.sandbox, nil) config.sandbox.project = Project.new(config.sandbox, nil)
Xcodeproj::Project.new('path').save_as(config.sandbox.project_path) Xcodeproj::Project.new(config.sandbox.project_path).save
@library = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox) @library = AggregateTarget.new(@podfile.target_definitions['Pods'], config.sandbox)
@library.client_root = sample_project_path.dirname @library.client_root = sample_project_path.dirname
@library.user_project_path = sample_project_path @library.user_project_path = sample_project_path
......
...@@ -348,7 +348,7 @@ module Pod ...@@ -348,7 +348,7 @@ module Pod
it "saves the project to the given path" do it "saves the project to the given path" do
path = temporary_directory + 'Pods/Pods.xcodeproj' path = temporary_directory + 'Pods/Pods.xcodeproj'
@installer.pods_project.expects(:save_as).with(path) @installer.pods_project.expects(:save)
@installer.send(:write_pod_project) @installer.send(:write_pod_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