From a42f009ded929070d5c412284c50ba08f0f9e8b8 Mon Sep 17 00:00:00 2001 From: Mai Hussien <70515749+mai93@users.noreply.github.com> Date: Wed, 30 Aug 2023 06:00:09 -0700 Subject: [PATCH] register java toolchain (#1510) --- scala/private/rules/scala_binary.bzl | 5 ++++- scala/private/rules/scala_library.bzl | 15 ++++++++++++--- scala/private/rules/scala_test.bzl | 5 ++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/scala/private/rules/scala_binary.bzl b/scala/private/rules/scala_binary.bzl index 25a89d2c2..7604461fb 100644 --- a/scala/private/rules/scala_binary.bzl +++ b/scala/private/rules/scala_binary.bzl @@ -81,7 +81,10 @@ def make_scala_binary(*extras): common_outputs, *[extra["outputs"] for extra in extras if "outputs" in extra] ), - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, implementation = _scala_binary_impl, ) diff --git a/scala/private/rules/scala_library.bzl b/scala/private/rules/scala_library.bzl index 7cd05bbd8..1a4e6887d 100644 --- a/scala/private/rules/scala_library.bzl +++ b/scala/private/rules/scala_library.bzl @@ -97,7 +97,10 @@ def make_scala_library(*extras): common_outputs, *[extra["outputs"] for extra in extras if "outputs" in extra] ), - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, implementation = _scala_library_impl, ) @@ -191,7 +194,10 @@ def make_scala_library_for_plugin_bootstrapping(*extras): common_outputs, *[extra["outputs"] for extra in extras if "outputs" in extra] ), - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, implementation = _scala_library_for_plugin_bootstrapping_impl, ) @@ -259,7 +265,10 @@ def make_scala_macro_library(*extras): common_outputs, *[extra["outputs"] for extra in extras if "outputs" in extra] ), - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, implementation = _scala_macro_library_impl, ) diff --git a/scala/private/rules/scala_test.bzl b/scala/private/rules/scala_test.bzl index 5120bef00..4f1948705 100644 --- a/scala/private/rules/scala_test.bzl +++ b/scala/private/rules/scala_test.bzl @@ -120,7 +120,10 @@ def make_scala_test(*extras): *[extra["outputs"] for extra in extras if "outputs" in extra] ), test = True, - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, implementation = _scala_test_impl, )