Skip to content

Commit

Permalink
Bazel: Call _wrap_rule directly when building the Scala REPL rule. (#…
Browse files Browse the repository at this point in the history
…11279)

If we build the dependency lists in the `_create_scala_repl` function,
we don't add the correct `scalac` options; specifically, we don't add
the Silencer option to ignore unused imports from
`scala.collection .compat`.

By passing directly to `_wrap_rule`, we compute the `scalac` options
correctly.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
SamirTalwar authored Oct 18, 2021
1 parent edb2b04 commit 81fde97
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions bazel_tools/scala.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,7 @@ def _create_scaladoc_jar(

def _create_scala_repl(
name,
deps = [],
scala_deps = [],
versioned_deps = {},
versioned_scala_deps = {},
runtime_deps = [],
scala_runtime_deps = [],
tags = [],
# hiding the following from the `scala_repl` rule
main_class = None,
Expand All @@ -569,10 +564,9 @@ def _create_scala_repl(
generated_srcs = None,
**kwargs):
name = name + "_repl"
deps = resolve_scala_deps(deps, scala_deps, versioned_deps, versioned_scala_deps)
runtime_deps = resolve_scala_deps(runtime_deps, scala_runtime_deps) + ["@maven//:org_jline_jline"]
runtime_deps = runtime_deps + ["@maven//:org_jline_jline"]
tags = tags + ["manual"]
_wrap_rule(scala_repl, name = name, deps = deps, runtime_deps = runtime_deps, tags = tags, **kwargs)
_wrap_rule(scala_repl, name = name, runtime_deps = runtime_deps, tags = tags, **kwargs)

def da_scala_library(name, **kwargs):
"""
Expand Down

0 comments on commit 81fde97

Please sign in to comment.