From 236cafb4bde853184b189bb9affa9d704892279a Mon Sep 17 00:00:00 2001 From: Steven Parkes Date: Thu, 30 Jan 2020 12:28:03 -0800 Subject: [PATCH 1/2] use bind to remove loader-specific labels in dependencies --- scala/BUILD | 14 +++++++------- scala/private/macros/scala_repositories.bzl | 15 +++++++++++++++ scala/scalatest/BUILD | 4 ++-- src/java/io/bazel/rulesscala/scalac/BUILD | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/scala/BUILD b/scala/BUILD index a5c8f2416..7641b0eae 100644 --- a/scala/BUILD +++ b/scala/BUILD @@ -44,17 +44,17 @@ java_import( _declare_scalac_provider( name = "scalac_default", default_classpath = [ - "@io_bazel_rules_scala_scala_library", - "@io_bazel_rules_scala_scala_reflect", + "//external:io_bazel_rules_scala/dependency/scala/scala_library", + "//external:io_bazel_rules_scala/dependency/scala/scala_reflect", ], default_macro_classpath = [ - "@io_bazel_rules_scala_scala_library", - "@io_bazel_rules_scala_scala_reflect", + "//external:io_bazel_rules_scala/dependency/scala/scala_library", + "//external:io_bazel_rules_scala/dependency/scala/scala_reflect", ], default_repl_classpath = [ - "@io_bazel_rules_scala_scala_library", - "@io_bazel_rules_scala_scala_reflect", - "@io_bazel_rules_scala_scala_compiler", + "//external:io_bazel_rules_scala/dependency/scala/scala_library", + "//external:io_bazel_rules_scala/dependency/scala/scala_reflect", + "//external:io_bazel_rules_scala/dependency/scala/scala_compiler", ], visibility = ["//visibility:public"], ) diff --git a/scala/private/macros/scala_repositories.bzl b/scala/private/macros/scala_repositories.bzl index a822993a3..2cdbbee63 100644 --- a/scala/private/macros/scala_repositories.bzl +++ b/scala/private/macros/scala_repositories.bzl @@ -199,3 +199,18 @@ def scala_repositories( name = "io_bazel_rules_scala/dependency/scala/guava", actual = "@io_bazel_rules_scala_guava", ) + + native.bind( + name = "io_bazel_rules_scala/dependency/scalac_rules_commons_io", + actual = "@scalac_rules_commons_io", + ) + + native.bind( + name = "io_bazel_rules_scala/dependency/scala/scalatest/scalatest", + actual = "@io_bazel_rules_scala_scalatest", + ) + + native.bind( + name = "io_bazel_rules_scala/dependency/scala/scalactic/scalactic", + actual = "@io_bazel_rules_scala_scalactic", + ) diff --git a/scala/scalatest/BUILD b/scala/scalatest/BUILD index 2e4ad67bb..4e7439e96 100644 --- a/scala/scalatest/BUILD +++ b/scala/scalatest/BUILD @@ -6,7 +6,7 @@ scala_import( name = "scalatest", jars = [], exports = [ - "@io_bazel_rules_scala_scalactic", - "@io_bazel_rules_scala_scalatest", + "//external:io_bazel_rules_scala/dependency/scala/scalactic/scalactic", + "//external:io_bazel_rules_scala/dependency/scala/scalatest/scalatest", ], ) diff --git a/src/java/io/bazel/rulesscala/scalac/BUILD b/src/java/io/bazel/rulesscala/scalac/BUILD index ec7f89795..f63f60f30 100644 --- a/src/java/io/bazel/rulesscala/scalac/BUILD +++ b/src/java/io/bazel/rulesscala/scalac/BUILD @@ -20,10 +20,10 @@ java_binary( visibility = ["//visibility:public"], deps = [ ":exported_scalac_repositories_from_toolchain_to_jvm", + "//external:io_bazel_rules_scala/dependency/scalac_rules_commons_io", "//third_party/bazel/src/main/protobuf:worker_protocol_java_proto", "@io_bazel_rules_scala//src/java/io/bazel/rulesscala/jar", "@io_bazel_rules_scala//src/java/io/bazel/rulesscala/worker", - "@scalac_rules_commons_io//jar", ], ) From ebfea5df90f930c8164233ba648bd5f6284d5bad Mon Sep 17 00:00:00 2001 From: Steven Parkes Date: Mon, 2 Mar 2020 14:24:59 -0800 Subject: [PATCH 2/2] remove redundant bind --- scala/private/macros/scala_repositories.bzl | 5 ----- src/java/io/bazel/rulesscala/scalac/BUILD | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/scala/private/macros/scala_repositories.bzl b/scala/private/macros/scala_repositories.bzl index a2827d170..6febc7590 100644 --- a/scala/private/macros/scala_repositories.bzl +++ b/scala/private/macros/scala_repositories.bzl @@ -233,11 +233,6 @@ def scala_repositories( actual = "@io_bazel_rules_scala_guava", ) - native.bind( - name = "io_bazel_rules_scala/dependency/scalac_rules_commons_io", - actual = "@scalac_rules_commons_io", - ) - native.bind( name = "io_bazel_rules_scala/dependency/scala/scalatest/scalatest", actual = "@io_bazel_rules_scala_scalatest", diff --git a/src/java/io/bazel/rulesscala/scalac/BUILD b/src/java/io/bazel/rulesscala/scalac/BUILD index 4ceaaa01d..c6121878a 100644 --- a/src/java/io/bazel/rulesscala/scalac/BUILD +++ b/src/java/io/bazel/rulesscala/scalac/BUILD @@ -21,7 +21,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ ":exported_scalac_repositories_from_toolchain_to_jvm", - "//external:io_bazel_rules_scala/dependency/scalac_rules_commons_io", + "//external:io_bazel_rules_scala/dependency/commons_io/commons_io", "//third_party/bazel/src/main/protobuf:worker_protocol_java_proto", "@io_bazel_rules_scala//src/java/io/bazel/rulesscala/jar", "@io_bazel_rules_scala//src/java/io/bazel/rulesscala/worker",