Commit 3bb835b5 authored by Marius Rackwitz's avatar Marius Rackwitz

Ensure that resource bundles are named like specified

parent ccfcee2d
...@@ -82,12 +82,6 @@ module Pod ...@@ -82,12 +82,6 @@ module Pod
project.reference_for_path(res) project.reference_for_path(res)
end end
resource_refs += project.products_group.files.select do |product_ref|
file_accessor.resource_bundles.keys.any? do |bundle_name|
product_ref.path == "#{bundle_name}.bundle"
end
end
native_target.add_resources(resource_refs) native_target.add_resources(resource_refs)
end end
end end
...@@ -105,6 +99,11 @@ module Pod ...@@ -105,6 +99,11 @@ module Pod
file_references = paths.map { |sf| project.reference_for_path(sf) } file_references = paths.map { |sf| project.reference_for_path(sf) }
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.product_reference.tap do |bundle_product|
bundle_file_name = "#{bundle_name}.bundle"
bundle_product.name = bundle_file_name
bundle_product.path = bundle_file_name
end
bundle_target.add_resources(file_references) bundle_target.add_resources(file_references)
target.user_build_configurations.each do |bc_name, type| target.user_build_configurations.each do |bc_name, type|
...@@ -115,6 +114,9 @@ module Pod ...@@ -115,6 +114,9 @@ module Pod
if target.should_build? if target.should_build?
native_target.add_dependency(bundle_target) native_target.add_dependency(bundle_target)
if target.requires_frameworks?
native_target.add_resources([bundle_target.product_reference])
end
end end
bundle_target.build_configurations.each do |c| bundle_target.build_configurations.each do |c|
......
...@@ -103,7 +103,10 @@ module Pod ...@@ -103,7 +103,10 @@ module Pod
it 'adds the resource bundle targets' do it 'adds the resource bundle targets' do
@pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => []) @pod_target.file_accessors.first.stubs(:resource_bundles).returns('banana_bundle' => [])
@installer.install! @installer.install!
@project.targets.map(&:name).should == ['Pods-BananaLib', 'Pods-BananaLib-banana_bundle'] bundle_target = @project.targets.find { |t| t.name == 'Pods-BananaLib-banana_bundle' }
bundle_target.should.be.an.instance_of Xcodeproj::Project::Object::PBXNativeTarget
bundle_target.product_reference.name.should == 'banana_bundle.bundle'
bundle_target.product_reference.path.should == 'banana_bundle.bundle'
end end
it 'adds framework resources to the framework target' do it 'adds framework resources to the framework target' 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