Skip to content

Commit

Permalink
chore: make it clearer that the user should update to 3.2.x
Browse files Browse the repository at this point in the history
Right now there isn't a lot of support if you try to use coverage under
3.1.x for example. This will show you a warning that you need to update to
3.2.x if you try with a Scala 3 version that isn't new enough.
  • Loading branch information
ckipp01 committed Aug 8, 2022
1 parent 206a7c1 commit 98515aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 98515aa

Please sign in to comment.