Skip to content

Commit

Permalink
Also check Scala 3 artifacts in MiMa
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Aug 3, 2023
1 parent 1915c50 commit 9d80e1c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/binary-compatibility-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Report MiMa Binary Issues
run: |-
sbt "+~ ${{ matrix.scalaVersion }} mimaReportBinaryIssues"
sbt "+mimaReportBinaryIssues"
- name: Check correct MiMa filter directories
run: |
Expand Down
28 changes: 11 additions & 17 deletions project/MiMa.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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] =
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9d80e1c

Please sign in to comment.