Skip to content

Commit 0ae2127

Browse files
committed
Added cross build with Scala 2.13 for core and tests
The sbt plugin stays on Scala 2.12 as sbt 1.x does.
1 parent 220f97d commit 0ae2127

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

build.sbt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ commands += Command.command("testStaging") { state =>
2525
prep ::: "mimaReportBinaryIssues" :: state
2626
}
2727

28+
val supportedScalaVersions = Seq("2.12.13", "2.13.5")
29+
2830
val root = project.in(file(".")).settings(
2931
name := "mima",
3032
crossScalaVersions := Nil,
@@ -33,10 +35,13 @@ val root = project.in(file(".")).settings(
3335
)
3436
aggregateProjects(core, sbtplugin, functionalTests)
3537

36-
val munit = "org.scalameta" %% "munit" % "0.7.23"
38+
val munit = "org.scalameta" %% "munit" % "0.7.25"
39+
val scalaCollectionCompat = "org.scala-lang.modules" %% "scala-collection-compat" % "2.4.3"
3740

3841
val core = project.settings(
3942
name := "mima-core",
43+
crossScalaVersions := supportedScalaVersions,
44+
libraryDependencies += scalaCollectionCompat,
4045
libraryDependencies += munit % Test,
4146
testFrameworks += new TestFramework("munit.Framework"),
4247
MimaSettings.mimaSettings,
@@ -56,7 +61,7 @@ val core = project.settings(
5661
val sbtplugin = project.enablePlugins(SbtPlugin).dependsOn(core).settings(
5762
name := "sbt-mima-plugin",
5863
// drop the previous value to drop running Test/compile
59-
scriptedDependencies := Def.task(()).dependsOn(publishLocal, publishLocal in core).value,
64+
scriptedDependencies := Def.task(()).dependsOn(publishLocal, core / publishLocal).value,
6065
scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
6166
scriptedLaunchOpts += s"-Dsbt.boot.directory=${file(sys.props("user.home")) / ".sbt" / "boot"}",
6267
MimaSettings.mimaSettings,
@@ -67,6 +72,7 @@ val functionalTests = Project("functional-tests", file("functional-tests"))
6772
.dependsOn(core)
6873
.configs(IntegrationTest)
6974
.settings(
75+
crossScalaVersions := supportedScalaVersions,
7076
libraryDependencies += "com.typesafe" % "config" % "1.4.1",
7177
libraryDependencies += "io.get-coursier" %% "coursier" % "2.0.16",
7278
libraryDependencies += munit,

core/src/main/scala/com/typesafe/tools/mima/core/PackageInfo.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.typesafe.tools.mima.core
22

33
import scala.annotation.tailrec
44
import scala.collection.mutable
5+
import scala.collection.compat._
56

67
sealed class SyntheticPackageInfo(val owner: PackageInfo, val name: String) extends PackageInfo {
78
def definitions = owner.definitions
@@ -23,10 +24,12 @@ sealed class ConcretePackageInfo(val owner: PackageInfo, cp: ClassPath, pkg: Str
2324
def name = pkg.split('.').last
2425
def definitions = defs
2526

26-
lazy val packages =
27-
cp.packages(pkg).map { p =>
28-
p.stripPrefix(s"$pkg.") -> new ConcretePackageInfo(this, cp, p, defs)
29-
}.to[({type M[_] = mutable.Map[String, PackageInfo]})#M]
27+
lazy val packages: mutable.Map[String, PackageInfo] =
28+
mutable.Map.from(
29+
cp.packages(pkg).map { p =>
30+
p.stripPrefix(s"$pkg.") -> new ConcretePackageInfo(this, cp, p, defs)
31+
}
32+
)
3033

3134
lazy val classes =
3235
cp.classes(pkg).map { f =>

0 commit comments

Comments
 (0)