Skip to content

Commit acc31b2

Browse files
author
Jaden Peterson
committed
fixup! 16d68e9 Fixed failing test
1 parent a5d155c commit acc31b2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

scala_config.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ def _store_config(repository_ctx):
2929
)
3030

3131
# All versions supported
32-
scala_versions = repository_ctx.attr.scala_versions
32+
if "SCALA_VERSIONS" in repository_ctx.os.environ:
33+
scala_versions = repository_ctx.os.environ["SCALA_VERSIONS"].split(",")
34+
else:
35+
scala_versions = repository_ctx.attr.scala_versions
36+
3337
if not scala_versions:
3438
scala_versions = [scala_version]
3539
elif scala_version not in scala_versions:

test/shell/test_scala_config.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@ runner=$(get_test_runner "${1:-local}")
77
test_classpath_contains_2_12() {
88
bazel aquery 'mnemonic("Javac", //src/java/io/bazel/rulesscala/scalac:scalac)' \
99
--repo_env=SCALA_VERSION=2.12.20 \
10+
--repo_env=SCALA_VERSIONS=2.12.20 \
1011
| grep scala-library-2.12
1112
}
1213

1314
test_classpath_contains_2_13() {
1415
bazel aquery 'mnemonic("Javac", //src/java/io/bazel/rulesscala/scalac:scalac)' \
1516
--repo_env=SCALA_VERSION=2.13.15 \
17+
--repo_env=SCALA_VERSIONS=2.13.15 \
1618
| grep scala-library-2.13
1719
}
1820

1921
test_scala_config_content() {
20-
bazel build --repo_env=SCALA_VERSION=0.0.0 @io_bazel_rules_scala_config//:all 2> /dev/null
22+
bazel build \
23+
--repo_env=SCALA_VERSION=0.0.0 \
24+
--repo_env=SCALA_VERSIONS=0.0.0 \
25+
@io_bazel_rules_scala_config//:all 2> /dev/null
26+
2127
grep "SCALA_MAJOR_VERSION='0.0'" \
2228
"$(bazel info output_base)"/external/*io_bazel_rules_scala_config/config.bzl
2329
}

0 commit comments

Comments
 (0)