diff --git a/README.md b/README.md index 373601f867..e402c11ad4 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Scala CLI is a command-line tool to interact with the Scala language. It lets yo Scala code. (and more!) It shares some similarities with build tools, but it doesn't aim at supporting multi-module projects, nor to be extended via a task system. -As of [SIP-46](https://github.com/scala/improvement-proposals/pull/46), Scala CLI has been accepted as the new `scala` -command and is currently in the experimental phase. If you want to try it out, check for more -details [here](https://scala-cli.virtuslab.org/docs/reference/scala-command/). +As of Scala 3.5.0, Scala CLI has become the official `scala` runner of the language (for more information +refer to [SIP-46](https://github.com/scala/improvement-proposals/pull/46)). For more details on using Scala CLI +via the `scala` command, refer to [this doc](https://scala-cli.virtuslab.org/docs/reference/scala-command/). ## Docs - user-facing documentation: [scala-cli.virtuslab.org](https://scala-cli.virtuslab.org/) diff --git a/build.sc b/build.sc index 36936669af..29f92121c0 100644 --- a/build.sc +++ b/build.sc @@ -172,6 +172,26 @@ trait DocsTests extends CrossSbtModule with ScalaCliScalafixModule with HasTests } def forkEnv = super.forkEnv() ++ extraEnv() + def constantsFile = T.persistent { + val dir = T.dest / "constants" + val dest = dir / "Constants.scala" + val code = + s"""package sclicheck + | + |/** Build-time constants. Generated by mill. */ + |object Constants { + | def coursierOrg = "${Deps.coursier.dep.module.organization.value}" + | def coursierCliModule = "${Deps.coursierCli.dep.module.name.value}" + | def coursierCliVersion = "${Deps.Versions.coursierCli}" + | def defaultScalaVersion = "${Scala.defaultUser}" + |} + |""".stripMargin + if (!os.isFile(dest) || os.read(dest) != code) + os.write.over(dest, code, createFolders = true) + PathRef(dir) + } + def generatedSources = super.generatedSources() ++ Seq(constantsFile()) + object test extends ScalaCliTests with ScalaCliScalafixModule { def forkEnv = super.forkEnv() ++ extraEnv() ++ Seq( "SCALA_CLI_EXAMPLES" -> (os.pwd / "examples").toString, diff --git a/modules/docs-tests/src/main/scala/sclicheck/sclicheck.scala b/modules/docs-tests/src/main/scala/sclicheck/sclicheck.scala index b48cb42e02..60c5283ffd 100644 --- a/modules/docs-tests/src/main/scala/sclicheck/sclicheck.scala +++ b/modules/docs-tests/src/main/scala/sclicheck/sclicheck.scala @@ -13,7 +13,7 @@ import scala.util.matching.Regex val SnippetBlock = """ *(`{2}`+)[^ ]+ title=([\w\d.\-/_]+) *""".r val CompileBlock = """ *(`{2}`+) *(\w+) +(compile|fail) *(?:title=([\w\d.\-/_]+))? *(power)? *""".r def compileBlockEnds(backticks: String) = s""" *$backticks *""".r -val BashCommand = """ *```bash *(fail|run-fail)? *""".r +val BashCommand = """ *```bash *(fail|run-fail)? *(clean)? *""".r val CheckBlock = """ *\<\!-- Expected(-regex)?: *""".r val CheckBlockEnd = """ *\--> *""".r val Clear = """ *