scala_toolchain
allows you to define global configuration to all Scala targets.
Some scala_toolchain must be registered!
In your workspace file add the following lines:
# WORKSPACE
# register default scala toolchain
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
-
Add your own definition of
scala_toolchain
to aBUILD
file:# //toolchains/BUILD load("@io_bazel_rules_scala//scala:scala_toolchain.bzl", "scala_toolchain") scala_toolchain( name = "my_toolchain_impl", scalacopts = ["-Ywarn-unused"], unused_dependency_checker_mode = "off", visibility = ["//visibility:public"] ) toolchain( name = "my_scala_toolchain", toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", toolchain = "my_toolchain_impl", visibility = ["//visibility:public"] )
-
Register your custom toolchain from
WORKSPACE
:# WORKSPACE register_toolchains("//toolchains:my_scala_toolchain")
Attributes | |
---|---|
scalacopts |
Extra compiler options for this binary to be passed to scalac. |
scalac_jvm_flags |
List of JVM flags to be passed to scalac. For example
This is overridden by the |
scala_test_jvm_flags |
List of JVM flags to be passed to the ScalaTest runner. For example
This is overridden by the |
unused_dependency_checker_mode |
Enable unused dependency checking (see Unused dependency checking).
Possible values are: |
enable_code_coverage_aspect |
This enables instrumenting tests with jacoco code coverage. |