Skip to content

chore: make it clearer that the user should update to 3.2.x #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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