From 4c88573549e47b8ccbd83b42dc6535cc748e6863 Mon Sep 17 00:00:00 2001 From: Roland Tritsch Date: Mon, 2 Sep 2024 19:25:00 +0100 Subject: [PATCH 1/2] Make the patch version work for 10 >= 2. --- src/main/scala/scoverage/ScoverageSbtPlugin.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/scala/scoverage/ScoverageSbtPlugin.scala b/src/main/scala/scoverage/ScoverageSbtPlugin.scala index 4e3662d..96074ea 100644 --- a/src/main/scala/scoverage/ScoverageSbtPlugin.scala +++ b/src/main/scala/scoverage/ScoverageSbtPlugin.scala @@ -89,14 +89,13 @@ object ScoverageSbtPlugin extends AutoPlugin { } private def isScala3SupportingFilePackageExclusion(scalaVersion: String) = { - def patch = scalaVersion.split('.').drop(2).headOption + def patch = scalaVersion.split('.').map(_.toInt).drop(2).headOption CrossVersion .partialVersion(scalaVersion) .exists { - case (3, minor) - if minor > 4 || (minor == 4 && patch.exists(_ >= "2")) => - true - case _ => false + case (3, minor) if minor > 4 => true + case (3, minor) if (minor == 4 && patch.exists(_ >= 2)) => true + case _ => false } } From 76474405af6149e902d80d3f47d23a8141e2479b Mon Sep 17 00:00:00 2001 From: Roland Tritsch Date: Mon, 2 Sep 2024 19:26:01 +0100 Subject: [PATCH 2/2] Upgrade the excludeFilePackages test to 3.5.0. --- .../scoverage/scala3-coverage-excluded-files/build.sbt | 2 +- src/sbt-test/scoverage/scala3-coverage-excluded-files/test | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt b/src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt index 0fa5458..ebcc4f7 100644 --- a/src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt +++ b/src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt @@ -1,6 +1,6 @@ version := "0.1" -scalaVersion := "3.4.2" +scalaVersion := "3.5.0" libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test diff --git a/src/sbt-test/scoverage/scala3-coverage-excluded-files/test b/src/sbt-test/scoverage/scala3-coverage-excluded-files/test index 6b51572..33ed081 100644 --- a/src/sbt-test/scoverage/scala3-coverage-excluded-files/test +++ b/src/sbt-test/scoverage/scala3-coverage-excluded-files/test @@ -4,6 +4,6 @@ > test > coverageReport # There should be no directory for the excluded files -$ exists target/scala-3.4.2/scoverage-report/GoodCoverage.scala.html --$ exists target/scala-3.4.2/scoverage-report/two --$ exists target/scala-3.4.2/scoverage-report/three +$ exists target/scala-3.5.0/scoverage-report/GoodCoverage.scala.html +-$ exists target/scala-3.5.0/scoverage-report/two +-$ exists target/scala-3.5.0/scoverage-report/three