Skip to content

Commit

Permalink
Handle removal of ObjcProvider.direct_headers
Browse files Browse the repository at this point in the history
Handle bazelbuild/bazel#14559 (bazelbuild/bazel@8a2b711) to prepare for Bazel 6.0.0.
  • Loading branch information
mattrobmattrob committed Nov 28, 2022
1 parent 2c80b95 commit b9bc662
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions rules/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,15 @@ def _get_framework_files(ctx, deps):
private_header_out.append(destination)

has_header = False
for provider in [CcInfo, apple_common.Objc]:
if provider in dep:
for hdr in _get_direct_public_headers(provider, dep):
if hdr.path.endswith((".h", ".hh", ".hpp")):
has_header = True
header_in.append(hdr)
destination = paths.join(framework_dir, "Headers", hdr.basename)
header_out.append(destination)
elif hdr.path.endswith(".modulemap"):
modulemap_in = hdr
if CcInfo in dep:
for hdr in _get_direct_public_headers(provider, dep):
if hdr.path.endswith((".h", ".hh", ".hpp")):
has_header = True
header_in.append(hdr)
destination = paths.join(framework_dir, "Headers", hdr.basename)
header_out.append(destination)
elif hdr.path.endswith(".modulemap"):
modulemap_in = hdr

if not has_header:
# only thing is the generated module map -- we don't want it
Expand Down Expand Up @@ -409,10 +408,8 @@ def _get_direct_public_headers(provider, dep):
if PrivateHeadersInfo in dep:
return []
return dep[provider].compilation_context.direct_public_headers
elif provider == apple_common.Objc:
return dep[provider].direct_headers
else:
fail("Unknown provider " + provider + " only CcInfo and Objc supported")
fail("Unknown provider " + provider + " only CcInfo supported")

def _get_symlinked_framework_clean_action(ctx, framework_files, compilation_context_fields):
framework_name = ctx.attr.framework_name
Expand Down

0 comments on commit b9bc662

Please sign in to comment.