From 2e226c3e17b96c72e2cde05b44e1e03b01772403 Mon Sep 17 00:00:00 2001 From: Matt Dziuban Date: Fri, 5 Jan 2024 12:15:13 -0500 Subject: [PATCH] Update documentation. --- docs/modules/ROOT/pages/Scala_Module_Config.adoc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/Scala_Module_Config.adoc b/docs/modules/ROOT/pages/Scala_Module_Config.adoc index b583d04d972..eb85edd9a56 100644 --- a/docs/modules/ROOT/pages/Scala_Module_Config.adoc +++ b/docs/modules/ROOT/pages/Scala_Module_Config.adoc @@ -118,7 +118,21 @@ for details. All ``ScalaModule``s have a `console` and a `repl` target, to start a Scala console or an Ammonite Repl. -To use the latter, you can (and sometimes need to) customize the Ammonite version to work with your selected Scala version. +When using the `console`, you can configure its `scalac` options using the `consoleScalacOptions` target. + +For example, you may want to inherit all of your regular `scalacOptions` but disable `-Xfatal-warnings`: + +.Example: Using `consoleScalacOptions` to disable fatal warnings +[source,scala,subs="attributes,verbatim"] +---- +import mill._, scalalib._ + +object foo extends ScalaModule { + def consoleScalacOptions = scalacOptions().filterNot(o => o == "-Xfatal-warnings") +} +---- + +To use the `repl`, you can (and sometimes need to) customize the Ammonite version to work with your selected Scala version. Mill provides a default Ammonite version, but depending on the Scala version you are using, there may be no matching Ammonite release available. In order to start the repl, you may have to specify a different available Ammonite version.