Skip to content

Commit 775d008

Browse files
authored
DP-15708 - Upgrade scala to 2.13.15 (#7)
1 parent 8f7fc6d commit 775d008

25 files changed

+1305
-382
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ scalatest_toolchain()
8888
```
8989

9090
This will load the `rules_scala` repository at the commit sha
91-
`rules_scala_version` into your Bazel project and register a [scala_toolchain](docs/scala_toolchain.md) at the default Scala version (2.12.18)
91+
`rules_scala_version` into your Bazel project and register a [scala_toolchain](docs/scala_toolchain.md) at the default Scala version (2.12.20)
9292

9393
Then in your BUILD file just add the following so the rules will be available:
9494
```starlark
@@ -143,13 +143,13 @@ Previous minor versions may work but are supported only on a best effort basis.
143143
To configure Scala version you must call `scala_config(scala_version = "2.xx.xx")` and configure
144144
dependencies by declaring [scala_toolchain](docs/scala_toolchain.md).
145145
For a quick start you can use `scala_repositories()` and `scala_register_toolchains()`, which have
146-
dependency providers configured for `2.11.12`, `2.12.18` and `2.13.14` versions.
146+
dependency providers configured for `2.11.12`, `2.12.20` and `2.13.15` versions.
147147

148148

149149
```starlark
150150
# WORKSPACE
151151
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
152-
scala_config(scala_version = "2.13.14")
152+
scala_config(scala_version = "2.13.15")
153153

154154
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
155155
rules_proto_dependencies()

dt_patches/dt_patch_test.sh

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ run_test_local test_compiler_patch 2.12.15
101101
run_test_local test_compiler_patch 2.12.16
102102
run_test_local test_compiler_patch 2.12.17
103103
run_test_local test_compiler_patch 2.12.18
104+
run_test_local test_compiler_patch 2.12.19
105+
run_test_local test_compiler_patch 2.12.20
104106

105107
run_test_local test_compiler_patch 2.13.0
106108
run_test_local test_compiler_patch 2.13.1
@@ -115,6 +117,7 @@ run_test_local test_compiler_patch 2.13.10
115117
run_test_local test_compiler_patch 2.13.11
116118
run_test_local test_compiler_patch 2.13.12
117119
run_test_local test_compiler_patch 2.13.14
120+
run_test_local test_compiler_patch 2.13.15
118121

119122
run_test_local test_compiler_srcjar_error 2.12.11
120123
run_test_local test_compiler_srcjar_error 2.12.12
@@ -127,7 +130,10 @@ run_test_local test_compiler_srcjar 2.12.15
127130
run_test_local test_compiler_srcjar 2.12.16
128131
run_test_local test_compiler_srcjar_nonhermetic 2.12.17
129132
run_test_local test_compiler_srcjar_nonhermetic 2.12.18
133+
run_test_local test_compiler_srcjar_nonhermetic 2.12.19
134+
run_test_local test_compiler_srcjar_nonhermetic 2.12.20
130135

131136
run_test_local test_compiler_srcjar_nonhermetic 2.13.11
132137
run_test_local test_compiler_srcjar_nonhermetic 2.13.12
133138
run_test_local test_compiler_srcjar_nonhermetic 2.13.14
139+
run_test_local test_compiler_srcjar_nonhermetic 2.13.15

dt_patches/test_dt_patches_user_srcjar/WORKSPACE

+31-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "rules_python",
16+
sha256 = "ca77768989a7f311186a29747e3e95c936a41dffac779aff6b443db22290d913",
17+
strip_prefix = "rules_python-0.36.0",
18+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.36.0/rules_python-0.36.0.tar.gz",
19+
)
20+
21+
load("@rules_python//python:repositories.bzl", "py_repositories")
22+
23+
py_repositories()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../..",
@@ -91,6 +102,12 @@ srcjars_by_version = {
91102
"2.12.18": {
92103
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.18/scala-compiler-2.12.18-sources.jar?foo",
93104
},
105+
"2.12.19": {
106+
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.19/scala-compiler-2.12.19-sources.jar?foo",
107+
},
108+
"2.12.20": {
109+
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.20/scala-compiler-2.12.20-sources.jar?foo",
110+
},
94111
"2.13.11": {
95112
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.11/scala-compiler-2.13.11-sources.jar?foo",
96113
},
@@ -100,6 +117,9 @@ srcjars_by_version = {
100117
"2.13.14": {
101118
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.14/scala-compiler-2.13.14-sources.jar?foo",
102119
},
120+
"2.13.15": {
121+
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15-sources.jar?foo",
122+
},
103123
}
104124

105125
rules_scala_setup(scala_compiler_srcjar = srcjars_by_version[SCALA_VERSION])
@@ -111,12 +131,22 @@ rules_scala_toolchain_deps_repositories(
111131

112132
register_toolchains(":dt_scala_toolchain")
113133

114-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
134+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
115135

116136
rules_proto_dependencies()
117137

138+
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")
139+
140+
rules_proto_setup()
141+
142+
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
143+
118144
rules_proto_toolchains()
119145

146+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
147+
148+
protobuf_deps()
149+
120150
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
121151

122152
scala_register_toolchains()

examples/crossbuild/1_single/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ scala_library(
1414
scala_test(
1515
name = "test213",
1616
srcs = ["test.scala"],
17-
scala_version = "2.13.14",
17+
scala_version = "2.13.15",
1818
)
1919

2020
# This one will be compiled by 3.3 compiler (the default one):

examples/crossbuild/2_deps/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ scala_binary(
1919
name = "bin213",
2020
srcs = ["bin.scala"], # compiled with 2.13 (as per `scala_version`)
2121
main_class = "C",
22-
scala_version = "2.13.14",
22+
scala_version = "2.13.15",
2323
deps = [
2424
":lib", # compiled 2.13 (as per `scala_version`)
2525
":lib211", # compiled with 2.11 (that target overrides version)

examples/crossbuild/3_select/BUILD

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ scala_binary(
2222
name = "bin2",
2323
srcs = ["bin.scala"],
2424
main_class = "B",
25-
scala_version = "2.13.14",
25+
scala_version = "2.13.15",
2626
deps = [":lib"],
2727
)
2828

2929
scala_binary(
3030
name = "bin3",
3131
srcs = ["bin.scala"],
3232
main_class = "B",
33-
scala_version = "3.3.1",
33+
scala_version = "3.3.4",
3434
deps = [":lib"],
3535
)

examples/crossbuild/WORKSPACE

+25-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "rules_python",
16+
sha256 = "ca77768989a7f311186a29747e3e95c936a41dffac779aff6b443db22290d913",
17+
strip_prefix = "rules_python-0.36.0",
18+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.36.0/rules_python-0.36.0.tar.gz",
19+
)
20+
21+
load("@rules_python//python:repositories.bzl", "py_repositories")
22+
23+
py_repositories()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../..",
@@ -19,11 +30,11 @@ local_repository(
1930
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
2031

2132
scala_config(
22-
scala_version = "3.3.1",
33+
scala_version = "3.3.4",
2334
scala_versions = [
2435
"2.11.12",
25-
"2.13.14",
26-
"3.3.1",
36+
"2.13.15",
37+
"3.3.4",
2738
],
2839
)
2940

@@ -37,12 +48,22 @@ rules_scala_setup()
3748

3849
rules_scala_toolchain_deps_repositories()
3950

40-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
51+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
4152

4253
rules_proto_dependencies()
4354

55+
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")
56+
57+
rules_proto_setup()
58+
59+
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
60+
4461
rules_proto_toolchains()
4562

63+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
64+
65+
protobuf_deps()
66+
4667
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
4768

4869
scala_register_toolchains()

examples/scala3/WORKSPACE

+23-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,25 @@ http_archive(
1111
],
1212
)
1313

14+
http_archive(
15+
name = "rules_python",
16+
sha256 = "ca77768989a7f311186a29747e3e95c936a41dffac779aff6b443db22290d913",
17+
strip_prefix = "rules_python-0.36.0",
18+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.36.0/rules_python-0.36.0.tar.gz",
19+
)
20+
21+
load("@rules_python//python:repositories.bzl", "py_repositories")
22+
23+
py_repositories()
24+
1425
local_repository(
1526
name = "io_bazel_rules_scala",
1627
path = "../..",
1728
)
1829

1930
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
2031

21-
scala_config(scala_version = "3.3.1")
32+
scala_config(scala_version = "3.5.2")
2233

2334
load(
2435
"@io_bazel_rules_scala//scala:scala.bzl",
@@ -30,12 +41,22 @@ rules_scala_setup()
3041

3142
rules_scala_toolchain_deps_repositories(fetch_sources = True)
3243

33-
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
44+
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")
3445

3546
rules_proto_dependencies()
3647

48+
load("@rules_proto//proto:setup.bzl", "rules_proto_setup")
49+
50+
rules_proto_setup()
51+
52+
load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")
53+
3754
rules_proto_toolchains()
3855

56+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
57+
58+
protobuf_deps()
59+
3960
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
4061

4162
scala_register_toolchains()

examples/semanticdb/WORKSPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ local_repository(
2121

2222
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
2323

24-
scala_config(scala_version = "2.13.14")
24+
scala_config(scala_version = "2.13.15")
2525

2626
load(
2727
"@io_bazel_rules_scala//scala:scala.bzl",

scala_config.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("//scala:scala_cross_version.bzl", "extract_major_version", "extract_minor_
22

33
def _default_scala_version():
44
"""return the scala version for use in maven coordinates"""
5-
return "2.12.18"
5+
return "2.12.20"
66

77
def _validate_supported_scala_version(scala_major_version, scala_minor_version):
88
if scala_major_version == "2.11" and int(scala_minor_version) != 12:

test/shell/test_coverage_equals_in_target.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
44
. "${dir}"/test_helper.sh
55
runner=$(get_test_runner "${1:-local}")
66

7+
# Default to 2.12.20 for `diff` tests because other versions change the output.
8+
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"
9+
710
test_coverage_target_name_contains_equals_sign() {
8-
bazel coverage //test/coverage_filename_encoding:name-with-equals
11+
bazel coverage \
12+
--repo_env="SCALA_VERSION=${SCALA_VERSION}" \
13+
//test/coverage_filename_encoding:name-with-equals
914
diff test/coverage_filename_encoding/expected-coverage.dat $(bazel info bazel-testlogs)/test/coverage_filename_encoding/name-with-equals/coverage.dat
1015
}
1116

test/shell/test_coverage_scalatest.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
44
. "${dir}"/test_helper.sh
55
runner=$(get_test_runner "${1:-local}")
66

7+
# Default to 2.12.20 for `diff` tests because other versions change the output.
8+
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"
9+
710
test_coverage_on() {
8-
bazel coverage //test/coverage_scalatest:test-scalatest
11+
bazel coverage \
12+
--repo_env="SCALA_VERSION=${SCALA_VERSION}" \
13+
//test/coverage_scalatest:test-scalatest
914
diff test/coverage_scalatest/expected-coverage.dat $(bazel info bazel-testlogs)/test/coverage_scalatest/test-scalatest/coverage.dat
1015
}
1116

1217
test_coverage_includes_test_targets() {
1318
bazel coverage \
14-
--instrument_test_targets=True \
15-
//test/coverage_scalatest:test-scalatest
19+
--instrument_test_targets=True \
20+
//test/coverage_scalatest:test-scalatest
1621
grep -q "SF:test/coverage_scalatest/TestWithScalaTest.scala" $(bazel info bazel-testlogs)/test/coverage_scalatest/test-scalatest/coverage.dat
1722
}
1823

test/shell/test_coverage_scalatest_resources.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
44
. "${dir}"/test_helper.sh
55
runner=$(get_test_runner "${1:-local}")
66

7+
# Default to 2.12.20 for `diff` tests because other versions change the output.
8+
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"
9+
710
test_coverage_succeeds_resource_call() {
811
bazel coverage \
9-
--instrumentation_filter=^//test/coverage_scalatest_resources[:/] \
10-
//test/coverage_scalatest_resources/consumer:tests
12+
--repo_env="SCALA_VERSION=${SCALA_VERSION}" \
13+
--instrumentation_filter=^//test/coverage_scalatest_resources[:/] \
14+
//test/coverage_scalatest_resources/consumer:tests
1115
diff test/coverage_scalatest_resources/expected-coverage.dat $(bazel info bazel-testlogs)/test/coverage_scalatest_resources/consumer/tests/coverage.dat
1216
}
1317

1418
test_coverage_includes_resource_test_targets() {
1519
bazel coverage \
16-
--instrument_test_targets=True \
17-
//test/coverage_scalatest_resources/consumer:tests
20+
--instrument_test_targets=True \
21+
//test/coverage_scalatest_resources/consumer:tests
1822
grep -q "SF:test/coverage_scalatest_resources/consumer/src/test/scala/com/example/consumer/ConsumerSpec.scala" $(bazel info bazel-testlogs)/test/coverage_scalatest_resources/consumer/tests/coverage.dat
1923
}
2024

test/shell/test_coverage_specs2_with_junit.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
44
. "${dir}"/test_helper.sh
55
runner=$(get_test_runner "${1:-local}")
66

7+
# Default to 2.12.20 for `diff` tests because other versions change the output.
8+
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"
9+
710
test_coverage_on() {
8-
bazel coverage //test/coverage_specs2_with_junit:test-specs2-with-junit
11+
bazel coverage \
12+
--repo_env="SCALA_VERSION=${SCALA_VERSION}" \
13+
//test/coverage_specs2_with_junit:test-specs2-with-junit
914
diff test/coverage_specs2_with_junit/expected-coverage.dat $(bazel info bazel-testlogs)/test/coverage_specs2_with_junit/test-specs2-with-junit/coverage.dat
1015
}
1116

1217
test_coverage_includes_test_targets() {
1318
bazel coverage \
14-
--instrument_test_targets=True \
15-
//test/coverage_specs2_with_junit:test-specs2-with-junit
19+
--instrument_test_targets=True \
20+
//test/coverage_specs2_with_junit:test-specs2-with-junit
1621
grep -q "SF:test/coverage_specs2_with_junit/TestWithSpecs2WithJUnit.scala" $(bazel info bazel-testlogs)/test/coverage_specs2_with_junit/test-specs2-with-junit/coverage.dat
1722
}
1823

0 commit comments

Comments
 (0)