diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd01e9f..db03f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: java-version: ${{ matrix.java }} - name: Run tests - run: sbt scripted + run: sbt scripted "++ 3.x" test formatting: runs-on: ubuntu-latest @@ -52,4 +52,4 @@ jobs: - uses: sbt/setup-sbt@v1 - name: Check Formatting - run: sbt scalafmtSbtCheck scalafmtCheckAll + run: sbt scalafmtSbtCheck "+ scalafmtCheckAll" diff --git a/build.sbt b/build.sbt index e61d837..0235b1d 100644 --- a/build.sbt +++ b/build.sbt @@ -32,15 +32,25 @@ inThisBuild( lazy val root = Project("sbt-scoverage", file(".")) .enablePlugins(SbtPlugin, BuildInfoPlugin) .settings( + crossScalaVersions += "3.3.3", libraryDependencies ++= Seq( "org.scoverage" %% "scalac-scoverage-reporter" % scoverageVersion ), + pluginCrossBuild / sbtVersion := { + scalaBinaryVersion.value match { + case "2.12" => + (pluginCrossBuild / sbtVersion).value + case _ => + "2.0.0-M2" + } + }, buildInfoKeys := Seq[BuildInfoKey]("scoverageVersion" -> scoverageVersion), buildInfoPackage := "scoverage", Test / fork := false, Test / publishArtifact := false, Test / parallelExecution := false, scalacOptions := Seq( + "-language:implicitConversions", "-unchecked", "-deprecation", "-feature", diff --git a/project/build.properties b/project/build.properties index 04267b1..bc73906 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.9 +sbt.version=1.10.3 diff --git a/src/main/scala/scoverage/ScoverageSbtPlugin.scala b/src/main/scala/scoverage/ScoverageSbtPlugin.scala index 3fb5048..2a2cf46 100644 --- a/src/main/scala/scoverage/ScoverageSbtPlugin.scala +++ b/src/main/scala/scoverage/ScoverageSbtPlugin.scala @@ -1,7 +1,7 @@ package scoverage import sbt.Keys._ -import sbt._ +import sbt.{given, _} import sbt.internal.util.Util.isWindows import sbt.plugins.JvmPlugin import scoverage.reporter.CoberturaXmlWriter @@ -124,7 +124,7 @@ object ScoverageSbtPlugin extends AutoPlugin { private lazy val scalacSettings = Seq( Compile / compile / scalacOptions ++= { - implicit val log = streams.value.log + implicit val log: Logger = streams.value.log val excludedPackages = Option(coverageExcludedPackages.value.trim).filter(_.nonEmpty) @@ -241,7 +241,7 @@ object ScoverageSbtPlugin extends AutoPlugin { private lazy val coverageReport0 = Def.task { val target = coverageDataDir.value - implicit val log = streams.value.log + implicit val log: Logger = streams.value.log log.info(s"Waiting for measurement data to sync...") if (System.getProperty("os.name").toLowerCase.contains("windows")) { @@ -276,7 +276,7 @@ object ScoverageSbtPlugin extends AutoPlugin { } private lazy val coverageAggregate0 = Def.task { - implicit val log = streams.value.log + implicit val log: Logger = streams.value.log log.info(s"Aggregating coverage from subprojects...") val dataDirs = coverageDataDir.?.all(aggregateFilter).value