Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
16 changes: 9 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ 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,
scalaVersion := "2.12.13",
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")
Expand Down Expand Up @@ -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.substring(0, 3) + "_", ""),
scalaJSStage := FastOptStage
)

Expand All @@ -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+"
)

2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.4
sbt.version=1.5.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -44,6 +44,7 @@ class ScoveragePlugin(val global: Global) extends Plugin {
if (!opts.exists(_.startsWith("dataDir:")))
throw new RuntimeException("Cannot invoke plugin without specifying <dataDir>")
instrumentationComponent.setOptions(options)
true
}

override val optionsHelp: Option[String] = Some(Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down