Commit 1f17293f authored by Samuel Giddins's avatar Samuel Giddins

Fix checksums for external source pods

parent 867d055b
...@@ -119,10 +119,14 @@ module Pod ...@@ -119,10 +119,14 @@ module Pod
rescue => _ rescue => _
raise Informative, "Failed to download '#{name}'." raise Informative, "Failed to download '#{name}'."
end end
spec = download_result.spec
spec = download_result.spec
raise Informative, "Unable to find a specification for '#{name}'." unless spec raise Informative, "Unable to find a specification for '#{name}'." unless spec
# since the podspec might be cleaned, we want the checksum to refer
# to the json in the sandbox
spec.defined_in_file = nil
store_podspec(sandbox, spec) store_podspec(sandbox, spec)
sandbox.store_pre_downloaded_pod(name) sandbox.store_pre_downloaded_pod(name)
sandbox.store_checkout_source(name, download_result.checkout_options) sandbox.store_checkout_source(name, download_result.checkout_options)
...@@ -161,7 +165,7 @@ module Pod ...@@ -161,7 +165,7 @@ module Pod
when String when String
path = "#{name}.podspec" path = "#{name}.podspec"
path << '.json' if json path << '.json' if json
Specification.from_string(spec, path) Specification.from_string(spec, path).tap {|s| s.defined_in_file = nil }
when Specification when Specification
spec.dup spec.dup
else else
......
...@@ -103,8 +103,7 @@ module Pod ...@@ -103,8 +103,7 @@ module Pod
# #
def pod_added?(pod) def pod_added?(pod)
return true if resolved_pods.include?(pod) && !sandbox_pods.include?(pod) return true if resolved_pods.include?(pod) && !sandbox_pods.include?(pod)
return true unless folder_exist?(pod) return true if !folder_exist?(pod) && !sandbox.local?(pod)
return false if !folder_exist?(pod) && !sandbox.local?(pod)
false false
end end
......
...@@ -115,6 +115,7 @@ module Pod ...@@ -115,6 +115,7 @@ module Pod
next unless sandbox.local?(pod_name) next unless sandbox.local?(pod_name)
root_name = Specification.root_name(pod_name) root_name = Specification.root_name(pod_name)
paths = file_accessor.developer_files paths = file_accessor.developer_files
next if paths.empty?
group = pods_project.group_for_spec(root_name, :developer) group = pods_project.group_for_spec(root_name, :developer)
paths.each do |path| paths.each do |path|
ref = pods_project.add_file_reference(path, group, false) ref = pods_project.add_file_reference(path, group, false)
...@@ -203,10 +204,12 @@ module Pod ...@@ -203,10 +204,12 @@ module Pod
# #
def add_file_accessors_paths_to_pods_group(file_accessor_key, group_key = nil, reflect_file_system_structure_for_development = false) def add_file_accessors_paths_to_pods_group(file_accessor_key, group_key = nil, reflect_file_system_structure_for_development = false)
file_accessors.each do |file_accessor| file_accessors.each do |file_accessor|
pod_name = file_accessor.spec.name
local = sandbox.local?(pod_name)
paths = file_accessor.send(file_accessor_key) paths = file_accessor.send(file_accessor_key)
paths = allowable_project_paths(paths) paths = allowable_project_paths(paths)
next if paths.empty?
pod_name = file_accessor.spec.name
local = sandbox.local?(pod_name)
base_path = local ? common_path(paths) : nil base_path = local ? common_path(paths) : nil
group = pods_project.group_for_spec(pod_name, group_key) group = pods_project.group_for_spec(pod_name, group_key)
paths.each do |path| paths.each do |path|
......
...@@ -272,6 +272,7 @@ module Pod ...@@ -272,6 +272,7 @@ module Pod
end end
spec ||= Specification.from_file(output_path) spec ||= Specification.from_file(output_path)
spec.defined_in_file ||= output_path
unless spec.name == name unless spec.name == name
raise Informative, "The name of the given podspec `#{spec.name}` doesn't match the expected one `#{name}`" raise Informative, "The name of the given podspec `#{spec.name}` doesn't match the expected one `#{name}`"
......
...@@ -69,7 +69,6 @@ module Pod ...@@ -69,7 +69,6 @@ module Pod
describe 'Subclasses helpers' do describe 'Subclasses helpers' do
it 'pre-downloads the Pod and stores the relevant information in the sandbox' do it 'pre-downloads the Pod and stores the relevant information in the sandbox' do
@subject.expects(:validate_podspec).with do |spec| @subject.expects(:validate_podspec).with do |spec|
spec.defined_in_file.should.be.nil
spec.name.should == 'Reachability' spec.name.should == 'Reachability'
end end
@subject.send(:pre_download, config.sandbox) @subject.send(:pre_download, config.sandbox)
......
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