Skip to content

Commit

Permalink
Update changed versions used in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Oct 23, 2024
1 parent 24848c1 commit 531d85f
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 43 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ scalatest_toolchain()
```

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

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


```starlark
# WORKSPACE
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
scala_config(scala_version = "2.13.14")
scala_config(scala_version = "2.13.15")

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
Expand Down
6 changes: 5 additions & 1 deletion dt_patches/dt_patch_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ run_test_local test_compiler_patch 2.12.16
run_test_local test_compiler_patch 2.12.17
run_test_local test_compiler_patch 2.12.18
run_test_local test_compiler_patch 2.12.19
run_test_local test_compiler_patch 2.12.20

run_test_local test_compiler_patch 2.13.0
run_test_local test_compiler_patch 2.13.1
Expand All @@ -116,6 +117,7 @@ run_test_local test_compiler_patch 2.13.10
run_test_local test_compiler_patch 2.13.11
run_test_local test_compiler_patch 2.13.12
run_test_local test_compiler_patch 2.13.14
run_test_local test_compiler_patch 2.13.15

run_test_local test_compiler_srcjar_error 2.12.11
run_test_local test_compiler_srcjar_error 2.12.12
Expand All @@ -129,7 +131,9 @@ run_test_local test_compiler_srcjar 2.12.16
run_test_local test_compiler_srcjar_nonhermetic 2.12.17
run_test_local test_compiler_srcjar_nonhermetic 2.12.18
run_test_local test_compiler_srcjar_nonhermetic 2.12.19
run_test_local test_compiler_srcjar_nonhermetic 2.12.20

run_test_local test_compiler_srcjar_nonhermetic 2.13.11
run_test_local test_compiler_srcjar_nonhermetic 2.13.12
run_test_local test_compiler_srcjar_nonhermetic 2.13.14
run_test_local test_compiler_srcjar_nonhermetic 2.13.14
run_test_local test_compiler_srcjar_nonhermetic 2.13.15
6 changes: 6 additions & 0 deletions dt_patches/test_dt_patches_user_srcjar/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ srcjars_by_version = {
"2.12.19": {
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.19/scala-compiler-2.12.19-sources.jar?foo",
},
"2.12.20": {
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.20/scala-compiler-2.12.20-sources.jar?foo",
},
"2.13.11": {
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.11/scala-compiler-2.13.11-sources.jar?foo",
},
Expand All @@ -114,6 +117,9 @@ srcjars_by_version = {
"2.13.14": {
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.14/scala-compiler-2.13.14-sources.jar?foo",
},
"2.13.15": {
"url": "https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15-sources.jar?foo",
},
}

rules_scala_setup(scala_compiler_srcjar = srcjars_by_version[SCALA_VERSION])
Expand Down
2 changes: 1 addition & 1 deletion examples/crossbuild/1_single/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scala_library(
scala_test(
name = "test213",
srcs = ["test.scala"],
scala_version = "2.13.14",
scala_version = "2.13.15",
)

# This one will be compiled by 3.3 compiler (the default one):
Expand Down
2 changes: 1 addition & 1 deletion examples/crossbuild/2_deps/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ scala_binary(
name = "bin213",
srcs = ["bin.scala"], # compiled with 2.13 (as per `scala_version`)
main_class = "C",
scala_version = "2.13.14",
scala_version = "2.13.15",
deps = [
":lib", # compiled 2.13 (as per `scala_version`)
":lib211", # compiled with 2.11 (that target overrides version)
Expand Down
4 changes: 2 additions & 2 deletions examples/crossbuild/3_select/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ scala_binary(
name = "bin2",
srcs = ["bin.scala"],
main_class = "B",
scala_version = "2.13.14",
scala_version = "2.13.15",
deps = [":lib"],
)

scala_binary(
name = "bin3",
srcs = ["bin.scala"],
main_class = "B",
scala_version = "3.3.3",
scala_version = "3.3.4",
deps = [":lib"],
)
6 changes: 3 additions & 3 deletions examples/crossbuild/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ local_repository(
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")

scala_config(
scala_version = "3.3.3",
scala_version = "3.3.4",
scala_versions = [
"2.11.12",
"2.13.14",
"3.3.3",
"2.13.15",
"3.3.4",
],
)

Expand Down
2 changes: 1 addition & 1 deletion examples/scala3/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ local_repository(

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

scala_config(scala_version = "3.5.0")
scala_config(scala_version = "3.5.2")

load(
"@io_bazel_rules_scala//scala:scala.bzl",
Expand Down
2 changes: 1 addition & 1 deletion examples/semanticdb/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local_repository(

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

scala_config(scala_version = "2.13.14")
scala_config(scala_version = "2.13.15")

load(
"@io_bazel_rules_scala//scala:scala.bzl",
Expand Down
2 changes: 1 addition & 1 deletion scala_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("//scala:scala_cross_version.bzl", "extract_major_version", "extract_minor_

def _default_scala_version():
"""return the scala version for use in maven coordinates"""
return "2.12.19"
return "2.12.20"

def _validate_supported_scala_version(scala_major_version, scala_minor_version):
if scala_major_version == "2.11" and int(scala_minor_version) != 12:
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_coverage_equals_in_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "${dir}"/test_helper.sh
runner=$(get_test_runner "${1:-local}")

# Default to 2.12.19 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.19}"
# Default to 2.12.20 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"

test_coverage_target_name_contains_equals_sign() {
bazel coverage \
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_coverage_scalatest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "${dir}"/test_helper.sh
runner=$(get_test_runner "${1:-local}")

# Default to 2.12.19 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.19}"
# Default to 2.12.20 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"

test_coverage_on() {
bazel coverage \
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_coverage_scalatest_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "${dir}"/test_helper.sh
runner=$(get_test_runner "${1:-local}")

# Default to 2.12.19 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.19}"
# Default to 2.12.20 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"

test_coverage_succeeds_resource_call() {
bazel coverage \
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_coverage_specs2_with_junit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
. "${dir}"/test_helper.sh
runner=$(get_test_runner "${1:-local}")

# Default to 2.12.19 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.19}"
# Default to 2.12.20 for `diff` tests because other versions change the output.
SCALA_VERSION="${SCALA_VERSION:-2.12.20}"

test_coverage_on() {
bazel coverage \
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ function scala3_2_example() {
}

function scala3_3_example() {
test_example examples/scala3 "bazel build --repo_env=SCALA_VERSION=3.3.3 //..."
test_example examples/scala3 "bazel build --repo_env=SCALA_VERSION=3.3.4 //..."
}

function scala3_4_example() {
test_example examples/scala3 "bazel build --repo_env=SCALA_VERSION=3.4.3 //..."
}

function scala3_5_example() {
test_example examples/scala3 "bazel build --repo_env=SCALA_VERSION=3.5.0 //..."
test_example examples/scala3 "bazel build --repo_env=SCALA_VERSION=3.5.2 //..."
}

function semanticdb_example() {
Expand Down
2 changes: 1 addition & 1 deletion test/shell/test_invalid_scalacopts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_logs_not_contains() {
2>&1 | grep -v "$expected"
}

for scalaVersion in 2.12.19 2.13.14 3.3.3; do
for scalaVersion in 2.12.20 2.13.15 3.3.4; do
if [[ "$scalaVersion" == 3.* ]]; then
$runner test_logs_contains $scalaVersion "not-existing is not a valid choice for -source"
else
Expand Down
4 changes: 2 additions & 2 deletions test/shell/test_scala_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ runner=$(get_test_runner "${1:-local}")

test_classpath_contains_2_12() {
bazel aquery 'mnemonic("Javac", //src/java/io/bazel/rulesscala/scalac:scalac)' \
--repo_env=SCALA_VERSION=2.12.19 \
--repo_env=SCALA_VERSION=2.12.20 \
| grep scala-library-2.12
}

test_classpath_contains_2_13() {
bazel aquery 'mnemonic("Javac", //src/java/io/bazel/rulesscala/scalac:scalac)' \
--repo_env=SCALA_VERSION=2.13.14 \
--repo_env=SCALA_VERSION=2.13.15 \
| grep scala-library-2.13
}

Expand Down
2 changes: 1 addition & 1 deletion test/shell/test_semanticdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_produces_semanticdb(){
fi

if [ $scala_majver -eq 3 ]; then
local version_opt="--repo_env=SCALA_VERSION=3.3.3"
local version_opt="--repo_env=SCALA_VERSION=3.3.4"
fi


Expand Down
6 changes: 3 additions & 3 deletions test_cross_build/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ scala_config(
scala_version = "3.1.3",
scala_versions = [
"2.11.12",
"2.12.19",
"2.13.14",
"2.12.20",
"2.13.15",
"3.1.3",
"3.2.2",
"3.3.3",
"3.3.4",
],
)

Expand Down
16 changes: 8 additions & 8 deletions test_cross_build/scalafmt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ scalafmt_scala_library(
srcs = ["unformatted/unformatted-library2.scala"],
config = ":scala2-conf",
format = True,
scala_version = "2.13.14",
scala_version = "2.13.15",
)

scalafmt_scala_library(
name = "formatted-library2",
srcs = ["formatted/formatted-library2.scala"],
config = ":scala2-conf",
format = True,
scala_version = "2.13.14",
scala_version = "2.13.15",
)

scalafmt_scala_library(
name = "unformatted-library3",
srcs = ["unformatted/unformatted-library3.scala"],
config = ":scala3-conf",
format = True,
scala_version = "3.3.3",
scala_version = "3.3.4",
)

scalafmt_scala_library(
name = "formatted-library3",
srcs = ["formatted/formatted-library3.scala"],
config = ":scala3-conf",
format = True,
scala_version = "3.3.3",
scala_version = "3.3.4",
)

scalafmt_scala_binary(
Expand All @@ -53,7 +53,7 @@ scalafmt_scala_binary(
config = ":scala2-conf",
format = True,
main_class = "UnformattedBinary",
scala_version = "2.12.19",
scala_version = "2.12.20",
)

scalafmt_scala_library(
Expand All @@ -62,7 +62,7 @@ scalafmt_scala_library(
config = ":scala2-conf",
format = True,
main_class = "UnformattedBinary",
scala_version = "2.12.19",
scala_version = "2.12.20",
)

scalafmt_scala_binary(
Expand All @@ -88,15 +88,15 @@ scalafmt_scala_test(
srcs = ["unformatted/unformatted-test2.scala"],
config = ":scala2-conf",
format = True,
scala_version = "2.12.19",
scala_version = "2.12.20",
)

scalafmt_scala_test(
name = "formatted-test2",
srcs = ["formatted/formatted-test2.scala"],
config = ":scala2-conf",
format = True,
scala_version = "2.12.19",
scala_version = "2.12.20",
)

#default scala version is 3.1.3
Expand Down
4 changes: 2 additions & 2 deletions test_cross_build/version_specific/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library")
scala_library(
name = "since_3_3",
srcs = ["since_3_3.scala"],
scala_version = "3.3.3",
scala_version = "3.3.4",
)

scala_library(
Expand Down Expand Up @@ -43,7 +43,7 @@ scala_library(
"since_3_2.scala",
"since_3_3.scala",
],
scala_version = "3.3.3",
scala_version = "3.3.4",
)

scala_library(
Expand Down
4 changes: 2 additions & 2 deletions test_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e

scala_2_11_version="2.11.12"
scala_2_12_version="2.12.19"
scala_2_13_version="2.13.14"
scala_2_12_version="2.12.20"
scala_2_13_version="2.13.15"

SCALA_VERSION_DEFAULT=$scala_2_11_version

Expand Down

0 comments on commit 531d85f

Please sign in to comment.