Skip to content

Commit 26f0ffb

Browse files
committed
Update {junit,specs2_junit}_toolchain()
These macros now mirror the implementation of `scalatest_toolchain()`. However, I realized that the old pattern of calling `scalatest_repositories()` followed by `scalatest_toolchain()` will no longer work without first calling `scala_toolchains(scalatest = True)`. This is because the `alias` targets in `testing/BUILD` that replace the previous implementations all point to `@io_bazel_rules_scala_toolchains`. So if we want to keep these macros, it seems like we should maybe restore the original toolchain targets in `testing/BUILD`. If we don't, we can remove these macros, but we can document these as breaking changes, and update other documentation accordingly.
1 parent a86756a commit 26f0ffb

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

testing/junit.bzl

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
load("//junit:junit.bzl", _repositories = "junit_repositories")
2+
load("//scala:scala_cross_version.bzl", "version_suffix")
3+
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_VERSIONS")
24

35
def junit_repositories():
46
_repositories()
57

68
def junit_toolchain():
7-
native.register_toolchains("@io_bazel_rules_scala//testing:junit_toolchain")
9+
for scala_version in SCALA_VERSIONS:
10+
native.register_toolchains(str(Label(
11+
"//testing:junit_toolchain" + version_suffix(scala_version),
12+
)))

testing/scalatest.bzl

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
load("//scalatest:scalatest.bzl", _repositories = "scalatest_repositories")
21
load("//scala:scala_cross_version.bzl", "version_suffix")
2+
load("//scalatest:scalatest.bzl", _repositories = "scalatest_repositories")
33
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_VERSIONS")
44

55
def scalatest_repositories():
@@ -8,6 +8,5 @@ def scalatest_repositories():
88
def scalatest_toolchain():
99
for scala_version in SCALA_VERSIONS:
1010
native.register_toolchains(str(Label(
11-
"//testing:scalatest_toolchain" +
12-
version_suffix(scala_version),
11+
"//testing:scalatest_toolchain" + version_suffix(scala_version),
1312
)))

testing/specs2_junit.bzl

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
load("//scala:scala_cross_version.bzl", "version_suffix")
12
load("//specs2:specs2_junit.bzl", _repositories = "specs2_junit_repositories")
3+
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_VERSIONS")
24

35
def specs2_junit_repositories():
46
_repositories()
57

68
def specs2_junit_toolchain():
7-
native.register_toolchains("@io_bazel_rules_scala//testing:specs2_junit_toolchain")
9+
for scala_version in SCALA_VERSIONS:
10+
native.register_toolchains(str(Label(
11+
"//testing:specs2_junit_toolchain" + version_suffix(scala_version),
12+
)))

0 commit comments

Comments
 (0)