Skip to content

Commit f5e7b61

Browse files
Introduce SCALA_VERSIONS
A variable to hold all (possibly more than one in the future) configured versions of Scala. Co-authored-by: mkuta <[email protected]>
1 parent 2e0b945 commit f5e7b61

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scala_config.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ def _validate_supported_scala_version(scala_major_version, scala_minor_version):
1111
fail("Scala version must be newer or equal to 2.12.1 to use compiler dependency tracking.")
1212

1313
def _store_config(repository_ctx):
14+
# Default version
1415
scala_version = repository_ctx.os.environ.get(
1516
"SCALA_VERSION",
1617
repository_ctx.attr.scala_version,
1718
)
1819

20+
# All versions supported
21+
scala_versions = [scala_version]
22+
1923
enable_compiler_dependency_tracking = repository_ctx.os.environ.get(
2024
"ENABLE_COMPILER_DEPENDENCY_TRACKING",
2125
str(repository_ctx.attr.enable_compiler_dependency_tracking),
@@ -29,6 +33,7 @@ def _store_config(repository_ctx):
2933

3034
config_file_content = "\n".join([
3135
"SCALA_VERSION='" + scala_version + "'",
36+
"SCALA_VERSIONS=" + str(scala_versions),
3237
"SCALA_MAJOR_VERSION='" + scala_major_version + "'",
3338
"SCALA_MINOR_VERSION='" + scala_minor_version + "'",
3439
"ENABLE_COMPILER_DEPENDENCY_TRACKING=" + enable_compiler_dependency_tracking,

0 commit comments

Comments
 (0)