Skip to content

Commit

Permalink
add sbt 2.x cross build setting
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Oct 20, 2024
1 parent 7bda012 commit e61ba62
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -52,4 +52,4 @@ jobs:
- uses: sbt/setup-sbt@v1

- name: Check Formatting
run: sbt scalafmtSbtCheck scalafmtCheckAll
run: sbt scalafmtSbtCheck "+ scalafmtCheckAll"
10 changes: 10 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.9
sbt.version=1.10.3
8 changes: 4 additions & 4 deletions src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e61ba62

Please sign in to comment.