Commit 80569fde authored by Samuel Ford's avatar Samuel Ford

fix #1042 - keep absolute paths for local pods as is

parent 42560625
...@@ -76,6 +76,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -76,6 +76,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[#1840](https://github.com/CocoaPods/CocoaPods/issues/1840) [#1840](https://github.com/CocoaPods/CocoaPods/issues/1840)
[Core#71](https://github.com/CocoaPods/Core/pull/71) [Core#71](https://github.com/CocoaPods/Core/pull/71)
* Fix to keep absolute paths specified for local pods as is.
[Samuel Ford](https://github.com/samuelwford)
[#1042](https://github.com/CocoaPods/CocoaPods/issues/1042)
## 0.30.0 ## 0.30.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.29.0...0.30.0) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.29.0...0.30.0)
......
...@@ -352,7 +352,7 @@ module Pod ...@@ -352,7 +352,7 @@ module Pod
UI.titled_section("Fetching podspec for `#{name}` #{description}", { :verbose_prefix => "-> " }) do UI.titled_section("Fetching podspec for `#{name}` #{description}", { :verbose_prefix => "-> " }) do
podspec = podspec_path podspec = podspec_path
store_podspec(sandbox, podspec) store_podspec(sandbox, podspec)
sandbox.store_local_path(name, podspec.dirname) sandbox.store_local_path(name, podspec.dirname, Pathname.new(declared_path).absolute?)
end end
end end
...@@ -368,10 +368,15 @@ module Pod ...@@ -368,10 +368,15 @@ module Pod
# @!group Helpers # @!group Helpers
# @return [String] the path as declared in the podspec
#
def declared_path
(params[:path] || params[:local]).to_s
end
# @return [Pathname] the path of the podspec. # @return [Pathname] the path of the podspec.
# #
def podspec_path def podspec_path
declared_path = (params[:path] || params[:local]).to_s
path_with_ext = File.extname(declared_path) == '.podspec' ? declared_path : "#{declared_path}/#{name}.podspec" path_with_ext = File.extname(declared_path) == '.podspec' ? declared_path : "#{declared_path}/#{name}.podspec"
podfile_dir = File.dirname(podfile_path || '') podfile_dir = File.dirname(podfile_path || '')
absolute_path = File.expand_path(path_with_ext, podfile_dir) absolute_path = File.expand_path(path_with_ext, podfile_dir)
......
...@@ -295,9 +295,10 @@ module Pod ...@@ -295,9 +295,10 @@ module Pod
pod_names = pod_targets.map(&:pod_name).uniq pod_names = pod_targets.map(&:pod_name).uniq
pod_names.each do |pod_name| pod_names.each do |pod_name|
path = sandbox.pod_dir(pod_name)
local = sandbox.local?(pod_name) local = sandbox.local?(pod_name)
@pods_project.add_pod_group(pod_name, path, local) path = sandbox.pod_dir(pod_name)
was_absolute = sandbox.local_path_was_absolute?(pod_name)
@pods_project.add_pod_group(pod_name, path, local, was_absolute)
end end
if config.podfile_path if config.podfile_path
......
...@@ -69,6 +69,7 @@ module Pod ...@@ -69,6 +69,7 @@ module Pod
@head_pods = [] @head_pods = []
@checkout_sources = {} @checkout_sources = {}
@development_pods = {} @development_pods = {}
@development_pods_were_absolute = {}
end end
# @return [Lockfile] the manifest which contains the information about the # @return [Lockfile] the manifest which contains the information about the
...@@ -159,6 +160,16 @@ module Pod ...@@ -159,6 +160,16 @@ module Pod
end end
end end
# Returns true if the path as originally specified was absolute.
#
# @param [String] name
#
# @return [Bool] true if originally absolute
#
def local_path_was_absolute?(name)
@development_pods_were_absolute[name]
end
# @return [Pathname] the directory where to store the documentation. # @return [Pathname] the directory where to store the documentation.
# #
def documentation_dir def documentation_dir
...@@ -338,11 +349,15 @@ module Pod ...@@ -338,11 +349,15 @@ module Pod
# @param [#to_s] path # @param [#to_s] path
# The local path where the Pod is stored. # The local path where the Pod is stored.
# #
# @param [Bool] was_absolute
# True if the specified local path was absolute.
#
# @return [void] # @return [void]
# #
def store_local_path(name, path) def store_local_path(name, path, was_absolute = false)
root_name = Specification.root_name(name) root_name = Specification.root_name(name)
development_pods[root_name] = path.to_s development_pods[root_name] = path.to_s
@development_pods_were_absolute[root_name] = was_absolute
end end
# @return [Hash{String=>String}] The path of the Pods with a local source # @return [Hash{String=>String}] The path of the Pods with a local source
......
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