Commit 5156ab73 authored by Fabio Pelosin's avatar Fabio Pelosin

[UserProjectIntegrator] Return an absolute path for the workspace.

Closes #920
parent ab13151e
...@@ -142,7 +142,11 @@ module Pod ...@@ -142,7 +142,11 @@ module Pod
# #
def workspace_path def workspace_path
if podfile.workspace_path if podfile.workspace_path
Pathname.new(podfile.workspace_path) declared_path = podfile.workspace_path
path_with_ext = File.extname(declared_path) == '.xcworkspace' ? declared_path : "#{declared_path}.xcworkspace"
podfile_dir = File.dirname(podfile.defined_in_file || '')
absolute_path = File.expand_path(path_with_ext, podfile_dir)
Pathname.new(absolute_path)
elsif user_project_paths.count == 1 elsif user_project_paths.count == 1
project = user_project_paths.first.basename('.xcodeproj') project = user_project_paths.first.basename('.xcodeproj')
installation_root + "#{project}.xcworkspace" installation_root + "#{project}.xcworkspace"
......
platform :ios, '6.0'
workspace 'Workspace.xcworkspace'
# TODO: remove
xcodeproj 'SampleApp_1.xcodeproj'
target 'SampleApp_1' do
xcodeproj 'SampleApp_1.xcodeproj'
pod "Reachability", "3.1.0"
end
target :'SampleApp_2' do
xcodeproj 'SampleApp_2.xcodeproj'
pod "Reachability"
end
PODS:
- Reachability (3.1.0)
DEPENDENCIES:
- Reachability
- Reachability (= 3.1.0)
SPEC CHECKSUMS:
Reachability: ba94ecd4eaa037be3d0588b38956672588530c5b
COCOAPODS: 0.17.1
<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:SampleApp_1.xcodeproj'/><FileRef location='group:SampleApp_2.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace>
\ No newline at end of file
platform :ios, '6.0'
workspace 'Workspace.xcworkspace'
# TODO: remove
xcodeproj 'SampleApp_1.xcodeproj'
target 'SampleApp_1' do
xcodeproj 'SampleApp_1.xcodeproj'
pod "Reachability", "3.1.0"
end
target :'SampleApp_2' do
xcodeproj 'SampleApp_2.xcodeproj'
pod "Reachability"
end
...@@ -337,6 +337,10 @@ describe "Integration take 2" do ...@@ -337,6 +337,10 @@ describe "Integration take 2" do
check "install --no-update --no-doc", "install_podspec" check "install --no-update --no-doc", "install_podspec"
end end
describe "Performs an installation using a custom workspace" do
check "install --no-update --no-doc", "install_custom_workspace"
end
# @todo add tests for all the hooks API # @todo add tests for all the hooks API
# #
describe "Runs the Podfile callbacks" do describe "Runs the Podfile callbacks" do
......
...@@ -127,7 +127,10 @@ module Pod ...@@ -127,7 +127,10 @@ module Pod
it "uses the path of the workspace defined in the podfile" do it "uses the path of the workspace defined in the podfile" do
path = "a_path" path = "a_path"
@podfile.workspace(path) @podfile.workspace(path)
@integrator.send(:workspace_path).should == Pathname.new(path + ".xcworkspace") workspace_path = @integrator.send(:workspace_path)
workspace_path.to_s.should.end_with(path + ".xcworkspace")
workspace_path.should.be.absolute
workspace_path.class.should == Pathname
end end
it "names the workspace after the user project if needed" do it "names the workspace after the user project if needed" do
......
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