diff --git a/README.md b/README.md index c279783d..613d1f5a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ sbt-scoverage is an sbt plugin that offers support for Scala code coverage using [scoverage](https://github.com/scoverage/scalac-scoverage-plugin). This plugin supports Scala 2.12, 2.13, and 3. -*NOTE*: that ScalaJS and Scala Native support is limited to Scala 2. +**NOTE**: that ScalaJS and Scala Native support is limited to Scala 2. +**NOTE**: that Scala 3 support starts with 3.2.x. + ## Setup diff --git a/src/main/scala/scoverage/ScoverageSbtPlugin.scala b/src/main/scala/scoverage/ScoverageSbtPlugin.scala index 4a920c1d..515f4a03 100644 --- a/src/main/scala/scoverage/ScoverageSbtPlugin.scala +++ b/src/main/scala/scoverage/ScoverageSbtPlugin.scala @@ -110,6 +110,9 @@ object ScoverageSbtPlugin extends AutoPlugin { private lazy val scalacSettings = Seq( Compile / compile / scalacOptions ++= { + + implicit val log = streams.value.log + val updateReport = update.value if (coverageEnabled.value && isScala2(scalaVersion.value)) { val scoverageDeps: Seq[File] = @@ -168,6 +171,11 @@ object ScoverageSbtPlugin extends AutoPlugin { Seq( s"-coverage-out:${coverageDataDir.value.getAbsolutePath()}/scoverage-data" ) + } else if (coverageEnabled.value && !isScala2(scalaVersion.value)) { + log.warn( + "coverage in Scala 3 needs at lease 3.2.x. Please update your Scala version and try again." + ) + Nil } else { Nil }