Commit 951bc72c authored by Marius Rackwitz's avatar Marius Rackwitz

Duplicate Bundle Targets for each Pod Target

This is to ensure that the bundles will be placed in the right namespaced build path, so that they are found where expected by Xcode's Copy Resources build phases.
parent 4aa8509b
...@@ -102,18 +102,14 @@ module Pod ...@@ -102,18 +102,14 @@ module Pod
def add_resources_bundle_targets def add_resources_bundle_targets
target.file_accessors.each do |file_accessor| target.file_accessors.each do |file_accessor|
file_accessor.resource_bundles.each do |bundle_name, paths| file_accessor.resource_bundles.each do |bundle_name, paths|
# Add a dependency on an existing Resource Bundle target if possible
bundle_target = project.targets.find { |target| target.name == bundle_name }
unless bundle_target
file_references = paths.map { |sf| project.reference_for_path(sf) } file_references = paths.map { |sf| project.reference_for_path(sf) }
bundle_target = project.new_resources_bundle(bundle_name, file_accessor.spec_consumer.platform_name) label = target.resources_bundle_target_label(bundle_name)
bundle_target = project.new_resources_bundle(label, file_accessor.spec_consumer.platform_name)
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|
bundle_target.add_build_configuration(bc_name, type) bundle_target.add_build_configuration(bc_name, type)
end end
end
target.resource_bundle_targets << bundle_target target.resource_bundle_targets << bundle_target
...@@ -121,8 +117,9 @@ module Pod ...@@ -121,8 +117,9 @@ module Pod
native_target.add_dependency(bundle_target) native_target.add_dependency(bundle_target)
end end
if target.requires_frameworks?
bundle_target.build_configurations.each do |c| bundle_target.build_configurations.each do |c|
c.build_settings['PRODUCT_NAME'] = bundle_name
if target.requires_frameworks?
c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
end end
end end
......
...@@ -103,7 +103,7 @@ module Pod ...@@ -103,7 +103,7 @@ 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', 'banana_bundle'] @project.targets.map(&:name).should == ['Pods-BananaLib', 'Pods-BananaLib-banana_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