Commit a6a9f9ed authored by Fabio Pelosin's avatar Fabio Pelosin

[Sandbox] Use the realpath of the root.

Fixes pod lib lint
Closes #1566
parent f09bb136
......@@ -6,6 +6,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
###### Bug Fixes
* Fixed a bug which resulted in `pod lib lint` not being able to find the
headers.
[Fabio Pelosin](https://github.com/irrationalfab)
[#1566](https://github.com/CocoaPods/CocoaPods/issues/1566)
* Fixed the developer frameworks search paths so that
`$(SDKROOT)/Developer/Library/Frameworks` is used for iOS and
`$(DEVELOPER_LIBRARY_DIR)/Frameworks` is used for OS X
......
......@@ -62,13 +62,13 @@ module Pod
# @param [String, Pathname] root @see root
#
def initialize(root)
@root = Pathname.new(root)
FileUtils.mkdir_p(root)
@root = Pathname.new(root).realpath
@public_headers = HeadersStore.new(self, "Headers")
@predownloaded_pods = []
@head_pods = []
@checkout_sources = {}
@development_pods = {}
FileUtils.mkdir_p(@root)
end
# @return [Lockfile] the manifest which contains the information about the
......
......@@ -9,7 +9,7 @@ module Pod
# @return [Pathname] the absolute path of this header directory.
#
def root
@sandbox.root + @relative_path
@root ||= @sandbox.root + @relative_path
end
# @return [Sandbox] the sandbox where this header directory is stored.
......@@ -70,7 +70,8 @@ module Pod
namespaced_path.mkpath unless File.exist?(namespaced_path)
relative_header_paths.map do |relative_header_path|
source = (@sandbox.root + relative_header_path).relative_path_from(namespaced_path)
absolute_source = (@sandbox.root + relative_header_path)
source = absolute_source.relative_path_from(namespaced_path)
Dir.chdir(namespaced_path) do
FileUtils.ln_sf(source, relative_header_path.basename)
end
......
......@@ -11,6 +11,15 @@ module Pod
describe "In general" do
it "reads the real path of the root so it can be used to build relative paths" do
root_realpath = temporary_directory + 'Folder/SubFolder'
FileUtils.mkdir_p(root_realpath)
symlink = temporary_directory + 'symlink'
File.symlink(root_realpath, symlink)
sandbox = Pod::Sandbox.new(symlink + 'Sandbox')
sandbox.root.to_s.should.end_with 'Folder/SubFolder/Sandbox'
end
it "automatically creates its root if it doesn't exist" do
File.directory?(temporary_directory + 'Sandbox').should.be.true
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