Commit 85a52521 authored by Marius Rackwitz's avatar Marius Rackwitz

Add TargetInstaller#create_umbrella_header

parent 6665153f
......@@ -86,6 +86,31 @@ module Pod
end
end
# Generates a header which ensures that all header files are exported
# in the module map
#
# @yield_param [Generator::UmbrellaHeader]
# yielded once to configure the imports
#
def create_umbrella_header
path = target.umbrella_header_path
UI.message "- Generating umbrella header at #{UI.path(path)}" do
generator = Generator::UmbrellaHeader.new(target)
yield generator if block_given?
generator.save_as(path)
# Add the file to the support group and the native target,
# so it will been added to the header build phase
file_ref = add_file_to_support_group(path)
native_target.add_file_references([file_ref])
# Make the umbrella header public
build_file = native_target.headers_build_phase.build_file(file_ref)
build_file.settings ||= {}
build_file.settings['ATTRIBUTES'] = ['Public']
end
end
# Generates a dummy source file for each target so libraries that contain
# only categories build.
#
......
......@@ -14,7 +14,10 @@ module Pod
create_support_files_dir
create_suport_files_group
create_xcconfig_file
create_info_plist_file if target.requires_framework?
if target.requires_framework?
create_info_plist_file
create_umbrella_header
end
create_target_environment_header
create_bridge_support_file
create_copy_resources_script
......
......@@ -20,7 +20,12 @@ module Pod
add_files_to_build_phases
add_resources_bundle_targets
create_xcconfig_file
create_info_plist_file if target.requires_framework?
if target.requires_framework?
create_info_plist_file
create_umbrella_header do |generator|
generator.imports += target.file_accessors.map(&:public_headers).flatten.map(&:basename)
end
end
create_prefix_header
create_dummy_source
end
......
......@@ -156,6 +156,15 @@ module Pod
support_files_dir + "#{label}-Private.xcconfig"
end
# @return [Pathname] the absolute path of the header file which contains
# the exported foundation constants with framework version
# information and all headers, which should been exported in the
# module map.
#
def umbrella_header_path
support_files_dir + target_definition.label + "#{product_module_name}.h"
end
# @return [Pathname] the absolute path of the header file which contains
# the information about the installed pods.
#
......
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