Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Stop computing transitive_generated_headers.
Browse files Browse the repository at this point in the history
RELNOTES: None
PiperOrigin-RevId: 344857866
  • Loading branch information
thomasvl authored and swiple-rules-gardener committed Nov 30, 2020
1 parent eefede5 commit 5167ae9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
21 changes: 0 additions & 21 deletions swift/internal/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ arguments passed to specific compilation actions.
"transitive_defines": """\
`Depset` of `string`s. The transitive `defines` specified for the library that
propagated this provider and all of its dependencies.
""",
"transitive_generated_headers": """\
`Depset` of `File`s. The transitive generated header files that can be used by
Objective-C sources to interop with the transitive Swift libraries.
""",
"transitive_modules": """\
`Depset` of values returned from `swift_common.create_module`. The transitive
Expand Down Expand Up @@ -331,7 +327,6 @@ def create_swift_info(
"""

defines_set = sets.make()
generated_headers = []
for module in modules:
swift_module = module.swift
if not swift_module:
Expand All @@ -343,14 +338,6 @@ def create_swift_info(
sets.make(swift_module.defines),
)

# If this is both a Swift and a Clang module, then the header in its
# compilation context is its Swift generated header.
clang_module = module.clang
if clang_module:
generated_headers.extend(
clang_module.compilation_context.headers.to_list(),
)

defines = sets.to_list(defines_set)

# TODO(b/149999519): Remove the legacy `module_name`.
Expand All @@ -361,13 +348,9 @@ def create_swift_info(
module_name = modules[0].name

transitive_defines = []
transitive_generated_headers = []
transitive_modules = []
for swift_info in swift_infos:
transitive_defines.append(swift_info.transitive_defines)
transitive_generated_headers.append(
swift_info.transitive_generated_headers,
)
transitive_modules.append(swift_info.transitive_modules)

return SwiftInfo(
Expand All @@ -376,9 +359,5 @@ def create_swift_info(
module_name = module_name,
swift_version = swift_version,
transitive_defines = depset(defines, transitive = transitive_defines),
transitive_generated_headers = depset(
generated_headers,
transitive = transitive_generated_headers,
),
transitive_modules = depset(modules, transitive = transitive_modules),
)
12 changes: 0 additions & 12 deletions test/generated_header_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ def generated_header_test_suite():
target_under_test = "@build_bazel_rules_swift//test/fixtures/generated_header:auto_header",
)

# Verify that the generated header is propagated in `SwiftInfo`.
generate_header_and_module_map_provider_test(
name = "{}_automatically_named_header_is_propagated".format(name),
expected_files = [
"test/fixtures/generated_header/auto_header-Swift.h",
],
field = "transitive_generated_headers",
provider = "SwiftInfo",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/generated_header:auto_header",
)

# Verify that the generated module map is propagated in `apple_common.Objc`.
# TODO(b/148604334): Enable this when it analyzes correctly on all platforms.
# generate_header_and_module_map_provider_test(
Expand Down

0 comments on commit 5167ae9

Please sign in to comment.