From bd0c388125e12f4f173648fc4474f73160a5c628 Mon Sep 17 00:00:00 2001 From: Ittai Zeidman Date: Sat, 28 Dec 2019 21:28:41 +0200 Subject: [PATCH] Plugin expansion- Use input plugins param instead of ctx (#909) * See test failing * Use input plugins param instead of ctx --- scala/private/rule_impls.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/private/rule_impls.bzl b/scala/private/rule_impls.bzl index 34469e913..9cd37fc38 100644 --- a/scala/private/rule_impls.bzl +++ b/scala/private/rule_impls.bzl @@ -167,6 +167,7 @@ def compile_scala( unused_dependency_checker_mode = "off", unused_dependency_checker_ignored_targets = []): # look for any plugins: + input_plugins = plugins plugins = collect_plugin_paths(plugins) internal_plugin_jars = [] dependency_analyzer_mode = "off" @@ -238,8 +239,7 @@ CurrentTarget: {current_target} compiler_classpath = _join_path(compiler_classpath_jars.to_list(), separator) toolchain = ctx.toolchains["@io_bazel_rules_scala//scala:toolchain_type"] - scalacopts_expansion_targets = getattr(ctx.attr, "plugins", []) - scalacopts = [ctx.expand_location(v, scalacopts_expansion_targets) for v in toolchain.scalacopts + in_scalacopts] + scalacopts = [ctx.expand_location(v, input_plugins) for v in toolchain.scalacopts + in_scalacopts] scalac_args = """ Classpath: {cp}