Skip to content

Commit cc39091

Browse files
domizei385ckipp01
andauthored
updated sbt to 1.5.1, updated deprecated 0.13 config style (#311)
Co-authored-by: ckipp01 <[email protected]>
1 parent 65d7024 commit cc39091

File tree

9 files changed

+20
-13
lines changed

9 files changed

+20
-13
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
{ version: '2.12.12' },
2323
{ version: '2.12.11' },
2424
{ version: '2.12.10' },
25+
{ version: '2.13.5' },
2526
{ version: '2.13.4' },
2627
{ version: '2.13.3' },
2728
{ version: '2.13.2' },

.github/workflows/pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
{ version: '2.12.12' },
1919
{ version: '2.12.11' },
2020
{ version: '2.12.10' },
21+
{ version: '2.13.5' },
2122
{ version: '2.13.4' },
2223
{ version: '2.13.3' },
2324
{ version: '2.13.2' },

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
{ version: '2.12.12' },
2222
{ version: '2.12.11' },
2323
{ version: '2.12.10' },
24+
{ version: '2.13.5' },
2425
{ version: '2.13.4' },
2526
{ version: '2.13.3' },
2627
{ version: '2.13.2' },

build.sbt

+9-7
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ val Org = "org.scoverage"
88
val ScalatestVersion = "3.1.1"
99

1010
val bin212 = Seq("2.12.13", "2.12.12", "2.12.11", "2.12.10")
11-
val bin213 = Seq("2.13.4", "2.13.3", "2.13.2", "2.13.1", "2.13.0")
11+
val bin213 = Seq("2.13.5", "2.13.4", "2.13.3", "2.13.2", "2.13.1", "2.13.0")
1212

1313
val appSettings = Seq(
1414
organization := Org,
1515
scalaVersion := "2.12.13",
1616
crossScalaVersions := bin212 ++ bin213,
1717
crossVersion := CrossVersion.full,
1818
crossTarget := target.value / s"scala-${scalaVersion.value}",
19-
fork in Test := false,
19+
Test / fork := false,
2020
publishMavenStyle := true,
21-
publishArtifact in Test := false,
22-
parallelExecution in Test := false,
21+
Test / publishArtifact := false,
22+
Test / parallelExecution := false,
2323
scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-encoding", "utf8"),
24-
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
24+
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1),
2525
publishTo := {
2626
if (isSnapshot.value)
2727
Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
@@ -74,15 +74,17 @@ lazy val root = Project("scalac-scoverage", file("."))
7474

7575
lazy val runtime = CrossProject("scalac-scoverage-runtime", file("scalac-scoverage-runtime"))(JVMPlatform, JSPlatform)
7676
.crossType(CrossType.Full)
77+
.withoutSuffixFor(JVMPlatform)
7778
.settings(name := "scalac-scoverage-runtime")
7879
.settings(appSettings: _*)
7980
.settings(
8081
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % Test
8182
)
8283
.jvmSettings(
83-
fork in Test := true
84+
Test / fork := true
8485
)
8586
.jsSettings(
87+
crossVersion := CrossVersion.fullWith("sjs" + scalaJSVersion.take(1) + "_", ""),
8688
scalaJSStage := FastOptStage
8789
)
8890

@@ -100,6 +102,6 @@ lazy val plugin = Project("scalac-scoverage-plugin", file("scalac-scoverage-plug
100102
)
101103
)
102104
.settings(
103-
unmanagedSourceDirectories in Test += (sourceDirectory in Test).value / "scala-2.12+"
105+
(Test/ unmanagedSourceDirectories) += (Test / sourceDirectory).value / "scala-2.12+"
104106
)
105107

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.4.4
1+
sbt.version=1.5.1

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
22

33
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
44

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
66

77
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")

scalac-scoverage-plugin/src/main/scala/scoverage/plugin.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ScoveragePlugin(val global: Global) extends Plugin {
2121
private def parseExclusionEntry(entryName: String, inOption: String): Seq[String] =
2222
inOption.substring(entryName.length).split(";").map(_.trim).toIndexedSeq.filterNot(_.isEmpty)
2323

24-
override def processOptions(opts: List[String], error: String => Unit): Unit = {
24+
override def init(opts: List[String], error: String => Unit): Boolean = {
2525
val options = new ScoverageOptions
2626

2727
for (opt <- opts) {
@@ -44,6 +44,7 @@ class ScoveragePlugin(val global: Global) extends Plugin {
4444
if (!opts.exists(_.startsWith("dataDir:")))
4545
throw new RuntimeException("Cannot invoke plugin without specifying <dataDir>")
4646
instrumentationComponent.setOptions(options)
47+
true
4748
}
4849

4950
override val optionsHelp: Option[String] = Some(Seq(

scalac-scoverage-plugin/src/test/scala/scoverage/PluginCoverageScalaJsTest.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package scoverage
22

3-
import org.scalatest.{ BeforeAndAfterEachTestData, FunSuite, OneInstancePerTest }
3+
import org.scalatest.funsuite.AnyFunSuite
4+
import org.scalatest.{BeforeAndAfterEachTestData, OneInstancePerTest}
45

56
/**
67
* https://github.com/scoverage/scalac-scoverage-plugin/issues/196
78
*/
89
class PluginCoverageScalaJsTest
9-
extends FunSuite
10+
extends AnyFunSuite
1011
with OneInstancePerTest
1112
with BeforeAndAfterEachTestData
1213
with MacroSupport {

scalac-scoverage-plugin/src/test/scala/scoverage/ScoverageCompiler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object ScoverageCompiler {
7070
s"$userHome/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/$artifactId/$version/$artifactId-$version.jar",
7171
s"$userHome/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/$artifactId/$version/$artifactId-$version.jar",
7272
)
73-
jarPaths.map(new File(_)).filter(_.exists()).headOption
73+
jarPaths.map(new File(_)).find(_.exists())
7474
}
7575

7676
private def findIvyJar(groupId: String, artifactId: String, version: String, packaging: String = "jar"): Option[File] = {

0 commit comments

Comments
 (0)