Skip to content

Commit

Permalink
Make swift_module_alias not print a warning.
Browse files Browse the repository at this point in the history
RELNOTES: `swift_module_alias` no longer prints a warning about possible misuse.
PiperOrigin-RevId: 253095922
  • Loading branch information
allevato authored and swiple-rules-gardener committed Jun 13, 2019
1 parent ceecdc4 commit 01b4fab
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions swift/internal/swift_module_alias.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ def _swift_module_alias_impl(ctx):
if not module_name:
module_name = swift_common.derive_module_name(ctx.label)

# Print a warning message directing users to the new modules that they need to
# import. This "nag" is intended to prevent users from misusing this rule to
# simply forward imported modules.
warning = """\n
WARNING: The Swift target \"{target}\" (defining module {module_name}) is \
deprecated. Please update your BUILD targets and Swift code to import the \
following dependencies instead:\n\n""".format(
target = str(ctx.label),
module_name = module_name,
)
for dep_module_name, dep_target in module_mapping.items():
warning += ' - "{target}" (import {module_name})\n'.format(
target = str(dep_target),
module_name = dep_module_name,
)
print(warning + "\n")

# Generate a source file that imports each of the deps using `@_exported`.
reexport_src = derived_files.reexport_modules_src(ctx.actions, ctx.label.name)
ctx.actions.write(
Expand Down Expand Up @@ -170,10 +153,6 @@ after moving the physical build target as needed. (An exception to this is
runtime type metadata, which only encodes the module name of the type where the
symbol is defined; it is not repeated by the alias module.)
This rule unconditionally prints a message directing users to migrate from the
alias to the aliased modules---this is intended to prevent misuse of this rule
to create "umbrella modules".
> Caution: This rule uses the undocumented `@_exported` feature to re-export the
> `deps` in the new module. You depend on undocumented features at your own
> risk, as they may change in a future version of Swift.
Expand Down

0 comments on commit 01b4fab

Please sign in to comment.