From 9d80e1c5eca1c92f525aa8155c1fcb27dc46140c Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Thu, 3 Aug 2023 11:56:28 +0200 Subject: [PATCH] Also check Scala 3 artifacts in MiMa --- .../workflows/binary-compatibility-checks.yml | 6 ++-- project/MiMa.scala | 28 ++++++++----------- project/plugins.sbt | 2 +- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/binary-compatibility-checks.yml b/.github/workflows/binary-compatibility-checks.yml index 172aabc6f41..f9656d43b19 100644 --- a/.github/workflows/binary-compatibility-checks.yml +++ b/.github/workflows/binary-compatibility-checks.yml @@ -30,11 +30,11 @@ jobs: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 - - name: Setup Java 11 + - name: Setup Java 8 uses: actions/setup-java@v3 with: distribution: temurin - java-version: 11 + java-version: 8 - name: Cache Coursier cache uses: coursier/cache-action@v6.4.0 @@ -47,7 +47,7 @@ jobs: - name: Report MiMa Binary Issues run: |- - sbt "+~ ${{ matrix.scalaVersion }} mimaReportBinaryIssues" + sbt "+mimaReportBinaryIssues" - name: Check correct MiMa filter directories run: | diff --git a/project/MiMa.scala b/project/MiMa.scala index 3e32e8b3981..4bdbb9f573d 100644 --- a/project/MiMa.scala +++ b/project/MiMa.scala @@ -29,7 +29,7 @@ object MiMa extends AutoPlugin { override val projectSettings = Seq( mimaReportSignatureProblems := true, - mimaPreviousArtifacts := pekkoPreviousArtifacts(name.value, organization.value, scalaBinaryVersion.value), + mimaPreviousArtifacts := pekkoPreviousArtifacts(name.value, organization.value), checkMimaFilterDirectories := checkFilterDirectories(baseDirectory.value)) def checkFilterDirectories(moduleRoot: File): Unit = { @@ -43,25 +43,19 @@ object MiMa extends AutoPlugin { def pekkoPreviousArtifacts( projectName: String, - organization: String, - scalaBinaryVersion: String): Set[sbt.ModuleID] = { - if (scalaBinaryVersion.startsWith("3")) { - // No binary compatibility for 3.0 artifacts for now - experimental - Set.empty - } else { - val versions: Seq[String] = { - val firstPatchOf10 = 0 + organization: String): Set[sbt.ModuleID] = { + val versions: Seq[String] = { + val firstPatchOf10 = 0 - val pekko10Previous = expandVersions(1, 0, 0 to latestPatchOf10) + val pekko10Previous = expandVersions(1, 0, 0 to latestPatchOf10) - pekko10Previous - } - - // check against all binary compatible artifacts - versions.map { v => - organization %% projectName % v - }.toSet + pekko10Previous } + + // check against all binary compatible artifacts + versions.map { v => + organization %% projectName % v + }.toSet } private def expandVersions(major: Int, minor: Int, patches: immutable.Seq[Int]): immutable.Seq[String] = diff --git a/project/plugins.sbt b/project/plugins.sbt index d2b18b84dc7..f0cdfcf10d9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -16,7 +16,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33") // sbt-osgi 0.9.5 is available but breaks including jdk9-only classes // sbt-osgi 0.9.6 is available but breaks populating pekko-protobuf-v3 addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.4") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")