Commit ef9a9f0d authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4672 from CocoaPods/seg-podfile-fixes

Fix issues found during Podfile testing
parents 2f233077 c44dd83e
...@@ -141,14 +141,19 @@ module Pod ...@@ -141,14 +141,19 @@ module Pod
# @return [void] # @return [void]
# #
def store_podspec(sandbox, spec, json = false) def store_podspec(sandbox, spec, json = false)
case spec spec = case spec
when Pathname when Pathname
spec = Specification.from_file(spec) Specification.from_file(spec)
when String when String
path = "#{name}.podspec" path = "#{name}.podspec"
path << '.json' if json path << '.json' if json
spec = Specification.from_string(spec, path) Specification.from_string(spec, path)
when Specification
spec.dup
else
raise "Unknown spec type: #{spec}"
end end
spec.defined_in_file = nil
validate_podspec(spec) validate_podspec(spec)
sandbox.store_podspec(name, spec.to_pretty_json, true, true) sandbox.store_podspec(name, spec.to_pretty_json, true, true)
end end
......
...@@ -144,7 +144,6 @@ module Pod ...@@ -144,7 +144,6 @@ module Pod
label = target.resources_bundle_target_label(bundle_name) label = target.resources_bundle_target_label(bundle_name)
bundle_target = project.new_resources_bundle(label, file_accessor.spec_consumer.platform_name) bundle_target = project.new_resources_bundle(label, file_accessor.spec_consumer.platform_name)
bundle_target.deployment_target = deployment_target
bundle_target.product_reference.tap do |bundle_product| bundle_target.product_reference.tap do |bundle_product|
bundle_file_name = "#{bundle_name}.bundle" bundle_file_name = "#{bundle_name}.bundle"
bundle_product.name = bundle_file_name bundle_product.name = bundle_file_name
...@@ -155,6 +154,7 @@ module Pod ...@@ -155,6 +154,7 @@ module Pod
target.user_build_configurations.each do |bc_name, type| target.user_build_configurations.each do |bc_name, type|
bundle_target.add_build_configuration(bc_name, type) bundle_target.add_build_configuration(bc_name, type)
end end
bundle_target.deployment_target = deployment_target
target.resource_bundle_targets << bundle_target target.resource_bundle_targets << bundle_target
......
...@@ -32,7 +32,10 @@ module Pod ...@@ -32,7 +32,10 @@ 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 { |spec| spec.name.should == 'Reachability' } @subject.expects(:validate_podspec).with do |spec|
spec.defined_in_file.should.be.nil
spec.name.should == 'Reachability'
end
@subject.send(:pre_download, config.sandbox) @subject.send(:pre_download, config.sandbox)
path = config.sandbox.specifications_root + 'Reachability.podspec.json' path = config.sandbox.specifications_root + 'Reachability.podspec.json'
path.should.exist? path.should.exist?
......
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