Skip to content

Commit

Permalink
Enable mima for interpreter-api and jupyter-api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Mar 22, 2019
1 parent b854636 commit 2854de8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -e

sbt ++$TRAVIS_SCALA_VERSION'!' "show version" test
sbt ++$TRAVIS_SCALA_VERSION'!' "show version" test mimaReportBinaryIssues
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ lazy val protocol = project
lazy val `interpreter-api` = project
.underShared
.settings(
shared
shared,
mima
)

lazy val interpreter = project
Expand Down Expand Up @@ -105,6 +106,7 @@ lazy val `jupyter-api` = project
.dependsOn(`interpreter-api`)
.settings(
shared,
mima,
libraryDependencies += Deps.jvmRepr
)

Expand Down
23 changes: 23 additions & 0 deletions project/Mima.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import sys.process._

object Mima {

private def stable(ver: String): Boolean =
ver.exists(c => c != '0' && c != '.') &&
ver
.replace("-RC", "-")
.forall(c => c == '.' || c == '-' || c.isDigit)

def binaryCompatibilityVersions: Set[String] =
Seq("git", "tag", "--merged", "HEAD^", "--contains", "v0.3.1")
.!!
.linesIterator
.map(_.trim)
.filter(_.startsWith("v"))
.map(_.stripPrefix("v"))
.filter(_ != "0.3.1") // Mima enabled right after it
.filter(stable)
.toSet

}
9 changes: 9 additions & 0 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.Files

import com.typesafe.tools.mima.plugin.MimaPlugin
import sbt._
import sbt.Keys._

Expand Down Expand Up @@ -155,4 +156,12 @@ object Settings {
}
}

lazy val mima = Seq(
MimaPlugin.autoImport.mimaPreviousArtifacts := {
Mima.binaryCompatibilityVersions.map { ver =>
(organization.value % moduleName.value % ver).cross(crossVersion.value)
}
}
)

}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0")
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.11")
addSbtCoursier

0 comments on commit 2854de8

Please sign in to comment.