Ensure we don't break binary compatibility in lm-coursier

This commit is contained in:
Alexandre Archambault 2019-04-25 17:16:49 +02:00
parent 5739ea7b60
commit 62d1ab0249
2 changed files with 34 additions and 0 deletions

View File

@ -21,6 +21,7 @@ lazy val `lm-coursier` = project
.in(file("modules/lm-coursier"))
.settings(
shared,
Mima.settings,
libraryDependencies ++= Seq(
"io.get-coursier" %% "coursier" % coursierVersion0,
// We depend on librarymanagement-ivy rather than just

33
project/Mima.scala Normal file
View File

@ -0,0 +1,33 @@
import com.typesafe.tools.mima.plugin.MimaPlugin
import sbt._
import sbt.Keys._
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", "736d5c11")
.!!
.linesIterator
.map(_.trim)
.filter(_.startsWith("v"))
.map(_.stripPrefix("v"))
.filter(stable)
.toSet
def settings: Seq[Setting[_]] = Seq(
MimaPlugin.autoImport.mimaPreviousArtifacts := {
binaryCompatibilityVersions.map { ver =>
(organization.value % moduleName.value % ver).cross(crossVersion.value)
}
}
)
}