Skip to content

Commit

Permalink
Return module_map target from the apple_library macro, since the objc…
Browse files Browse the repository at this point in the history
  • Loading branch information
amberdixon committed Nov 19, 2021
1 parent 3a6b5a7 commit 7f4fe87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rules/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7f4fe87

Please sign in to comment.