Skip to content

Commit b69907d

Browse files
authored
Update scalac opts in test reporter to support Scala 3 (#1353)
For Scala 3 some opts have to be removed because according to the docs, they are not implemented yet.
1 parent 7e22a7e commit b69907d

File tree

1 file changed

+67
-34
lines changed

1 file changed

+67
-34
lines changed

scala/support/BUILD

Lines changed: 67 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,73 @@ load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_MAJOR_VERSION")
44
scala_library(
55
name = "test_reporter",
66
srcs = ["JUnitXmlReporter.scala"],
7-
scalacopts = [
8-
"-deprecation:true",
9-
"-encoding",
10-
"UTF-8",
11-
"-feature",
12-
"-language:existentials",
13-
"-language:higherKinds",
14-
"-language:implicitConversions",
15-
"-unchecked",
16-
"-Xfatal-warnings",
17-
"-Xlint",
18-
"-Ywarn-dead-code",
19-
"-Ywarn-numeric-widen",
20-
"-Ywarn-value-discard",
21-
"-Wunused:imports",
22-
] if SCALA_MAJOR_VERSION == "2.13" else [
23-
"-deprecation:true",
24-
"-encoding",
25-
"UTF-8",
26-
"-feature",
27-
"-language:existentials",
28-
"-language:higherKinds",
29-
"-language:implicitConversions",
30-
"-unchecked",
31-
"-Xfatal-warnings",
32-
"-Xlint",
33-
"-Yno-adapted-args",
34-
"-Ywarn-dead-code",
35-
"-Ywarn-numeric-widen",
36-
"-Ywarn-value-discard",
37-
"-Xfuture",
38-
"-Ywarn-unused-import",
39-
"-Ypartial-unification",
40-
],
7+
scalacopts = {
8+
"3.1": [
9+
"-deprecation:true",
10+
"-encoding",
11+
"UTF-8",
12+
"-feature",
13+
"-language:existentials",
14+
"-language:higherKinds",
15+
"-language:implicitConversions",
16+
"-unchecked",
17+
"-Xfatal-warnings",
18+
],
19+
"2.13": [
20+
"-deprecation:true",
21+
"-encoding",
22+
"UTF-8",
23+
"-feature",
24+
"-language:existentials",
25+
"-language:higherKinds",
26+
"-language:implicitConversions",
27+
"-unchecked",
28+
"-Xfatal-warnings",
29+
"-Xlint",
30+
"-Ywarn-dead-code",
31+
"-Ywarn-numeric-widen",
32+
"-Ywarn-value-discard",
33+
"-Wunused:imports",
34+
],
35+
"2.12": [
36+
"-deprecation:true",
37+
"-encoding",
38+
"UTF-8",
39+
"-feature",
40+
"-language:existentials",
41+
"-language:higherKinds",
42+
"-language:implicitConversions",
43+
"-unchecked",
44+
"-Xfatal-warnings",
45+
"-Xlint",
46+
"-Yno-adapted-args",
47+
"-Ywarn-dead-code",
48+
"-Ywarn-numeric-widen",
49+
"-Ywarn-value-discard",
50+
"-Xfuture",
51+
"-Ywarn-unused-import",
52+
"-Ypartial-unification",
53+
],
54+
"2.11": [
55+
"-deprecation:true",
56+
"-encoding",
57+
"UTF-8",
58+
"-feature",
59+
"-language:existentials",
60+
"-language:higherKinds",
61+
"-language:implicitConversions",
62+
"-unchecked",
63+
"-Xfatal-warnings",
64+
"-Xlint",
65+
"-Yno-adapted-args",
66+
"-Ywarn-dead-code",
67+
"-Ywarn-numeric-widen",
68+
"-Ywarn-value-discard",
69+
"-Xfuture",
70+
"-Ywarn-unused-import",
71+
"-Ypartial-unification",
72+
],
73+
}[SCALA_MAJOR_VERSION],
4174
visibility = ["//visibility:public"],
4275
deps = [
4376
"//scala/private/toolchain_deps:scala_xml",

0 commit comments

Comments
 (0)