diff --git a/rules/rules_scala.bzl b/rules/rules_scala.bzl index 19b0c5332..fb15dc7d4 100644 --- a/rules/rules_scala.bzl +++ b/rules/rules_scala.bzl @@ -56,12 +56,7 @@ emulate_rules_scala_repository = repository_rule( implementation = _emulate_rules_scala_repository_impl, ) -def emulate_rules_scala(scala, scalatest, extra_deps = []): - native.bind( - name = "scala_annex/compat/rules_scala/scala", - actual = scala, - ) - +def emulate_rules_scala(scalatest, extra_deps = []): native.bind( name = "scala_annex/compat/rules_scala/extra_deps", actual = "@io_bazel_rules_scala//scala:extra_deps", diff --git a/rules/rules_scala/private/compat.bzl b/rules/rules_scala/private/compat.bzl index 76fe37ce3..718f21d40 100644 --- a/rules/rules_scala/private/compat.bzl +++ b/rules/rules_scala/private/compat.bzl @@ -23,8 +23,6 @@ load( _extra_deps = ["//external:scala_annex/compat/rules_scala/extra_deps"] -_scala = "//external:scala_annex/compat/rules_scala/scala" - _scalatest_deps = ["//external:scala_annex/compat/rules_scala/scalatest_dep"] def scala_library( @@ -33,20 +31,21 @@ def scala_library( tags = [], visibility = None, # rules_scala common attributes - srcs = [], - deps = [], - plugins = [], - runtime_deps = [], data = [], - resources = [], - resource_strip_prefix = None, - resource_jars = [], - scalacopts = [], + deps = [], + javac_jvm_flags = [], javacopts = [], jvm_flags = [], - scalac_jvm_flags = [], - javac_jvm_flags = [], + plugins = [], print_compile_time = False, + resource_jars = [], + resource_strip_prefix = None, + resources = [], + runtime_deps = [], + scala_toolchain_name = None, + scalac_jvm_flags = [], + scalacopts = [], + srcs = [], # library only attributes main_class = None, exports = [], @@ -80,13 +79,13 @@ def scala_library( name = name, srcs = srcs, deps_used_whitelist = _extra_deps, + exports = exports, macro = not _use_ijar, - scala = _scala, + runtime_deps = runtime_deps, + scala_toolchain_name = scala_toolchain_name, scalacopts = scalacopts, tags = tags, visibility = visibility, - exports = exports, - runtime_deps = runtime_deps, deps = deps + _extra_deps, ) @@ -96,20 +95,21 @@ def scala_macro_library( tags = [], visibility = None, # rules_scala common attributes - srcs = [], - deps = [], - plugins = [], - runtime_deps = [], data = [], - resources = [], - resource_strip_prefix = None, - resource_jars = [], - scalacopts = [], + deps = [], + javac_jvm_flags = [], javacopts = [], jvm_flags = [], - scalac_jvm_flags = [], - javac_jvm_flags = [], + plugins = [], print_compile_time = False, + resource_jars = [], + resource_strip_prefix = None, + resources = [], + runtime_deps = [], + scala_toolchain_name = None, + scalac_jvm_flags = [], + scalacopts = [], + srcs = [], # library only attributes main_class = None, exports = []): @@ -117,20 +117,21 @@ def scala_macro_library( name, tags, visibility, - srcs, - deps, - plugins, - runtime_deps, data, - resources, - resource_strip_prefix, - resource_jars, - scalacopts, + deps, + javac_jvm_flags, javacopts, jvm_flags, - scalac_jvm_flags, - javac_jvm_flags, + plugins, print_compile_time, + resource_jars, + resource_strip_prefix, + resources, + runtime_deps, + scala_toolchain_name, + scalac_jvm_flags, + scalacopts, + srcs, main_class, exports, False, # _use_ijar @@ -142,20 +143,21 @@ def scala_binary( tags = [], visibility = None, # rules_scala common attributes - srcs = [], - deps = [], - plugins = [], - runtime_deps = [], data = [], - resources = [], - resource_strip_prefix = None, - resource_jars = [], - scalacopts = [], + deps = [], + javac_jvm_flags = [], javacopts = [], jvm_flags = [], - scalac_jvm_flags = [], - javac_jvm_flags = [], + plugins = [], print_compile_time = False, + resource_jars = [], + resource_strip_prefix = None, + resources = [], + runtime_deps = [], + scala_toolchain_name = None, + scalac_jvm_flags = [], + scalacopts = [], + srcs = [], # binary only attributes main_class = None, classpath_resources = [], @@ -192,9 +194,9 @@ def scala_binary( srcs = srcs, deps_used_whitelist = _extra_deps, main_class = main_class, - scala = _scala, - tags = tags, runtime_deps = runtime_deps, + scala_toolchain_name = scala_toolchain_name, + tags = tags, deps = deps + _extra_deps, ) @@ -204,20 +206,21 @@ def scala_test( tags = [], visibility = None, # rules_scala common attributes - srcs = [], - deps = [], - plugins = [], - runtime_deps = [], data = [], - resources = [], - resource_strip_prefix = None, - resource_jars = [], - scalacopts = [], + deps = [], + javac_jvm_flags = [], javacopts = [], jvm_flags = [], - scalac_jvm_flags = [], - javac_jvm_flags = [], + plugins = [], print_compile_time = False, + resource_jars = [], + resource_strip_prefix = None, + resources = [], + runtime_deps = [], + scala_toolchain_name = None, + scalac_jvm_flags = [], + scalacopts = [], + srcs = [], # test only attributes suites = [], colors = None, @@ -260,39 +263,41 @@ def scala_test( srcs = srcs, deps_used_whitelist = _extra_deps, frameworks = ["org.scalatest.tools.Framework"], - scala = _scala, - tags = tags, runtime_deps = runtime_deps, + scala_toolchain_name = scala_toolchain_name, + tags = tags, deps = deps + _scalatest_deps + _extra_deps, ) def scala_test_suite( name, srcs = [], - deps = [], - runtime_deps = [], + colors = True, data = [], + deps = [], + full_stacktraces = True, + jvm_flags = [], resources = [], + runtime_deps = [], + scala_toolchain_name = None, scalacopts = [], - jvm_flags = [], - visibility = None, size = None, - colors = True, - full_stacktraces = True): + visibility = None): tests = [] for src in srcs: test_name = "%s_test_suite_%s" % (name, _safe_name(src)) scala_test( name = test_name, - size = size, srcs = [src], colors = colors, full_stacktraces = full_stacktraces, jvm_flags = jvm_flags, resources = resources, + runtime_deps = runtime_deps, + scala_toolchain_name = scala_toolchain_name, scalacopts = scalacopts, + size = size, visibility = visibility, - runtime_deps = runtime_deps, deps = deps, ) tests.append(test_name) diff --git a/tests/WORKSPACE b/tests/WORKSPACE index f135ae3f3..41730bd06 100644 --- a/tests/WORKSPACE +++ b/tests/WORKSPACE @@ -143,7 +143,6 @@ emulate_rules_scala( "@annex//:org_scala_lang_scala_reflect", "@annex_test//:org_scala_lang_modules_scala_xml_2_13", ], - scala = "@//scala:2_13", scalatest = "@scalatest_2_13//jar", )