Commit 305b80d6 authored by Boris Bügling's avatar Boris Bügling

Generate resource bundle targets for not-build targets.

This can been skipped for not-build targets. In addition, there needs to
be a target dependency from the aggregate target to the resource bundle
target so that it is actually getting built.
parent 9258cd3a
...@@ -447,7 +447,14 @@ module Pod ...@@ -447,7 +447,14 @@ module Pod
def set_target_dependencies def set_target_dependencies
aggregate_targets.each do |aggregate_target| aggregate_targets.each do |aggregate_target|
aggregate_target.pod_targets.each do |pod_target| aggregate_target.pod_targets.each do |pod_target|
next unless pod_target.should_build? unless pod_target.should_build?
pod_target.resource_bundle_targets.each do |resource_bundle_target|
aggregate_target.native_target.add_dependency(resource_bundle_target)
end
next
end
aggregate_target.native_target.add_dependency(pod_target.native_target) aggregate_target.native_target.add_dependency(pod_target.native_target)
pod_target.dependencies.each do |dep| pod_target.dependencies.each do |dep|
......
...@@ -9,7 +9,10 @@ module Pod ...@@ -9,7 +9,10 @@ module Pod
# @return [void] # @return [void]
# #
def install! def install!
return unless target.should_build? unless target.should_build?
add_resources_bundle_targets
return
end
UI.message "- Installing target `#{target.name}` #{target.platform}" do UI.message "- Installing target `#{target.name}` #{target.platform}" do
add_target add_target
...@@ -66,19 +69,29 @@ module Pod ...@@ -66,19 +69,29 @@ module Pod
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 # Add a dependency on an existing Resource Bundle target if possible
if bundle_target = project.targets.find { |target| target.name == bundle_name } bundle_target = project.targets.find { |target| target.name == bundle_name }
native_target.add_dependency(bundle_target)
next unless bundle_target
file_references = paths.map { |sf| project.reference_for_path(sf) }
bundle_target = project.new_resources_bundle(bundle_name, file_accessor.spec_consumer.platform_name)
bundle_target.add_resources(file_references)
target.user_build_configurations.each do |bc_name, type|
bundle_target.add_build_configuration(bc_name, type)
end
if target.requires_frameworks?
bundle_target.build_configurations.each do |c|
c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
end
end
end end
file_references = paths.map { |sf| project.reference_for_path(sf) }
bundle_target = project.new_resources_bundle(bundle_name, file_accessor.spec_consumer.platform_name)
bundle_target.add_resources(file_references)
target.user_build_configurations.each do |bc_name, type| target.resource_bundle_targets << bundle_target
bundle_target.add_build_configuration(bc_name, type)
end
native_target.add_dependency(bundle_target) if target.should_build?
native_target.add_dependency(bundle_target)
end
end end
end end
end end
......
...@@ -21,6 +21,7 @@ module Pod ...@@ -21,6 +21,7 @@ module Pod
@sandbox = sandbox @sandbox = sandbox
@build_headers = Sandbox::HeadersStore.new(sandbox, 'Private') @build_headers = Sandbox::HeadersStore.new(sandbox, 'Private')
@file_accessors = [] @file_accessors = []
@resource_bundle_targets = []
end end
# @return [String] the label for the target. # @return [String] the label for the target.
...@@ -34,6 +35,10 @@ module Pod ...@@ -34,6 +35,10 @@ module Pod
# #
attr_accessor :file_accessors attr_accessor :file_accessors
# @return [Array<PBXTarget>] the resource bundle targets belonging
# to this target.
attr_reader :resource_bundle_targets
# @return [Bool] Whether or not this target should be build. # @return [Bool] Whether or not this target should be build.
# #
# A target should not be build if it has no source files. # A target should not be build if it has no source files.
......
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