Skip to content
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

add sbt 2.x cross build setting #569

Merged
merged 1 commit into from
Nov 1, 2024
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: 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