Skip to content

Commit

Permalink
Add support for Scala 3.2.1 (#1465)
Browse files Browse the repository at this point in the history
- Add the build and repository definitions for Scala 3.2.1
- Add an extra set of tests for Scala 3.2.1

The current stable version of Scala is 3.2.1: https://github.com/lampepfl/dotty/releases/tag/3.2.1

Fixes #1464
  • Loading branch information
meisam authored Feb 27, 2023
1 parent f674f8f commit e63ba1e
Show file tree
Hide file tree
Showing 4 changed files with 560 additions and 3 deletions.
11 changes: 11 additions & 0 deletions scala/support/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ scala_library(
name = "test_reporter",
srcs = ["JUnitXmlReporter.scala"],
scalacopts = {
"3.2": [
"-deprecation:true",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
],
"3.1": [
"-deprecation:true",
"-encoding",
Expand Down
11 changes: 8 additions & 3 deletions test/shell/test_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ function multi_framework_toolchain_example() {
(cd examples/testing/multi_frameworks_toolchain; bazel test //...)
}

function scala3_example() {
(cd examples/scala3; bazel build //...)
function scala3_1_example() {
(cd examples/scala3; bazel build --repo_env=SCALA_VERSION=3.1.0 //...)
}

function scala3_2_example() {
(cd examples/scala3; bazel build --repo_env=SCALA_VERSION=3.2.1 //...)
}

$runner scalatest_repositories_example
$runner specs2_junit_repositories_example
$runner multi_framework_toolchain_example
$runner scala3_example
$runner scala3_1_example
$runner scala3_2_example
7 changes: 7 additions & 0 deletions third_party/repositories/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ load(
_artifacts_3_1 = "artifacts",
_scala_version_3_1 = "scala_version",
)
load(
"//third_party/repositories:scala_3_2.bzl",
_artifacts_3_2 = "artifacts",
_scala_version_3_2 = "scala_version",
)
load(
"@io_bazel_rules_scala//scala:scala_cross_version.bzl",
"default_maven_server_urls",
Expand All @@ -33,13 +38,15 @@ artifacts_by_major_scala_version = {
"2.12": _artifacts_2_12,
"2.13": _artifacts_2_13,
"3.1": _artifacts_3_1,
"3.2": _artifacts_3_2,
}

scala_version_by_major_scala_version = {
"2.11": _scala_version_2_11,
"2.12": _scala_version_2_12,
"2.13": _scala_version_2_13,
"3.1": _scala_version_3_1,
"3.2": _scala_version_3_2,
}

def repositories(
Expand Down
Loading

0 comments on commit e63ba1e

Please sign in to comment.