diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16c38c78..accf4a98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: { version: '2.12.12' }, { version: '2.12.11' }, { version: '2.12.10' }, + { version: '2.13.5' }, { version: '2.13.4' }, { version: '2.13.3' }, { version: '2.13.2' }, diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5cd20d5b..76522cc7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -18,6 +18,7 @@ jobs: { version: '2.12.12' }, { version: '2.12.11' }, { version: '2.12.10' }, + { version: '2.13.5' }, { version: '2.13.4' }, { version: '2.13.3' }, { version: '2.13.2' }, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76742b9a..0dee89a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: { version: '2.12.12' }, { version: '2.12.11' }, { version: '2.12.10' }, + { version: '2.13.5' }, { version: '2.13.4' }, { version: '2.13.3' }, { version: '2.13.2' }, diff --git a/build.sbt b/build.sbt index b33989bf..65621e5b 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ val Org = "org.scoverage" val ScalatestVersion = "3.1.1" val bin212 = Seq("2.12.13", "2.12.12", "2.12.11", "2.12.10") -val bin213 = Seq("2.13.4", "2.13.3", "2.13.2", "2.13.1", "2.13.0") +val bin213 = Seq("2.13.5", "2.13.4", "2.13.3", "2.13.2", "2.13.1", "2.13.0") val appSettings = Seq( organization := Org, @@ -16,12 +16,12 @@ val appSettings = Seq( crossScalaVersions := bin212 ++ bin213, crossVersion := CrossVersion.full, crossTarget := target.value / s"scala-${scalaVersion.value}", - fork in Test := false, + Test / fork := false, publishMavenStyle := true, - publishArtifact in Test := false, - parallelExecution in Test := false, + Test / publishArtifact := false, + Test / parallelExecution := false, scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-encoding", "utf8"), - concurrentRestrictions in Global += Tags.limit(Tags.Test, 1), + Global / concurrentRestrictions += Tags.limit(Tags.Test, 1), publishTo := { if (isSnapshot.value) Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots") @@ -74,15 +74,17 @@ lazy val root = Project("scalac-scoverage", file(".")) lazy val runtime = CrossProject("scalac-scoverage-runtime", file("scalac-scoverage-runtime"))(JVMPlatform, JSPlatform) .crossType(CrossType.Full) + .withoutSuffixFor(JVMPlatform) .settings(name := "scalac-scoverage-runtime") .settings(appSettings: _*) .settings( libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % Test ) .jvmSettings( - fork in Test := true + Test / fork := true ) .jsSettings( + crossVersion := CrossVersion.fullWith("sjs" + scalaJSVersion.take(1) + "_", ""), scalaJSStage := FastOptStage ) @@ -100,6 +102,6 @@ lazy val plugin = Project("scalac-scoverage-plugin", file("scalac-scoverage-plug ) ) .settings( - unmanagedSourceDirectories in Test += (sourceDirectory in Test).value / "scala-2.12+" + (Test/ unmanagedSourceDirectories) += (Test / sourceDirectory).value / "scala-2.12+" ) diff --git a/project/build.properties b/project/build.properties index 7de0a938..f0be67b9 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.4 +sbt.version=1.5.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 15a82faa..7c2b97ab 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,6 +2,6 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0") diff --git a/scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala b/scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala index 1ee7a069..4d4d0343 100644 --- a/scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala +++ b/scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala @@ -21,7 +21,7 @@ class ScoveragePlugin(val global: Global) extends Plugin { private def parseExclusionEntry(entryName: String, inOption: String): Seq[String] = inOption.substring(entryName.length).split(";").map(_.trim).toIndexedSeq.filterNot(_.isEmpty) - override def processOptions(opts: List[String], error: String => Unit): Unit = { + override def init(opts: List[String], error: String => Unit): Boolean = { val options = new ScoverageOptions for (opt <- opts) { @@ -44,6 +44,7 @@ class ScoveragePlugin(val global: Global) extends Plugin { if (!opts.exists(_.startsWith("dataDir:"))) throw new RuntimeException("Cannot invoke plugin without specifying ") instrumentationComponent.setOptions(options) + true } override val optionsHelp: Option[String] = Some(Seq( diff --git a/scalac-scoverage-plugin/src/test/scala/scoverage/PluginCoverageScalaJsTest.scala b/scalac-scoverage-plugin/src/test/scala/scoverage/PluginCoverageScalaJsTest.scala index fbe8b9d9..de04a6f8 100644 --- a/scalac-scoverage-plugin/src/test/scala/scoverage/PluginCoverageScalaJsTest.scala +++ b/scalac-scoverage-plugin/src/test/scala/scoverage/PluginCoverageScalaJsTest.scala @@ -1,12 +1,13 @@ package scoverage -import org.scalatest.{ BeforeAndAfterEachTestData, FunSuite, OneInstancePerTest } +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.{BeforeAndAfterEachTestData, OneInstancePerTest} /** * https://github.com/scoverage/scalac-scoverage-plugin/issues/196 */ class PluginCoverageScalaJsTest - extends FunSuite + extends AnyFunSuite with OneInstancePerTest with BeforeAndAfterEachTestData with MacroSupport { diff --git a/scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala b/scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala index c2185c23..cc2b6186 100644 --- a/scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala +++ b/scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala @@ -70,7 +70,7 @@ object ScoverageCompiler { s"$userHome/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/$artifactId/$version/$artifactId-$version.jar", s"$userHome/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/$artifactId/$version/$artifactId-$version.jar", ) - jarPaths.map(new File(_)).filter(_.exists()).headOption + jarPaths.map(new File(_)).find(_.exists()) } private def findIvyJar(groupId: String, artifactId: String, version: String, packaging: String = "jar"): Option[File] = {