diff --git a/rules/framework.bzl b/rules/framework.bzl index 5e67e4c2d..3f90d589b 100644 --- a/rules/framework.bzl +++ b/rules/framework.bzl @@ -53,6 +53,7 @@ def apple_framework(name, apple_library = apple_library, **kwargs): apple_framework_packaging( name = name, framework_name = library.namespace, + module_map = library.module_map, infoplists = infoplists, environment_plist = environment_plist, transitive_deps = library.transitive_deps, @@ -218,7 +219,7 @@ def _get_framework_files(ctx, deps): file_map = [] # modulemap - modulemap_in = None + modulemap_in = ctx.file.module_map # headermaps header_maps = [] @@ -290,13 +291,6 @@ def _get_framework_files(ctx, deps): # since it doesn't have a module_map field anyway continue - # collect modulemaps - for modulemap in dep[apple_common.Objc].direct_module_maps: - if modulemap.owner == dep.label: - # module map is generated by the objc_library, and does not come - # from the attr - continue - modulemap_in = modulemap binary_out = None modulemap_out = None @@ -612,6 +606,7 @@ apple_framework_packaging = rule( fragments = ["apple"], output_to_genfiles = True, attrs = { + "module_map": attr.label(allow_single_file = [".modulemap"]), "framework_name": attr.string( mandatory = True, doc = diff --git a/rules/library.bzl b/rules/library.bzl index 514fc2496..337ff7119 100644 --- a/rules/library.bzl +++ b/rules/library.bzl @@ -956,6 +956,7 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names lib_names = lib_names, import_vfsoverlays = import_vfsoverlays, transitive_deps = deps, + module_map = module_map, deps = lib_names + deps, module_name = module_name, launch_screen_storyboard_name = launch_screen_storyboard_name,