rules_scala
rules_scala copied to clipboard
java_compile_toolchain is not used for Scala compilation
trafficstars
steps
- globally set the java_runtime to JDK 8.
- set a target level java_compile_toolchain to JDK 11.
problem
@Duhemm found that in that situation Java source can use JDK 11 but Scala source cannot. For example:
package java11
object ScalaSource {
val hello = "hello".repeat(2)
}
expectations
Both Scala and Java can use JDK 11.
notes
_scalac is a program that points to @io_bazel_rules_scala//src/java/io/bazel/rulesscala/scalac, which is a java_binary target. The generated shell script assigns JAVABIN to the current Java runtime if JAVABIN environment variable is not set.