2019-04-25 17:16:49 +02:00
|
|
|
|
|
|
|
|
import com.typesafe.tools.mima.plugin.MimaPlugin
|
2019-07-02 14:01:08 +02:00
|
|
|
import com.typesafe.tools.mima.plugin.MimaKeys._
|
2019-04-25 17:16:49 +02:00
|
|
|
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] =
|
2020-02-04 12:21:09 +01:00
|
|
|
Seq("git", "tag", "--merged", "HEAD^", "--contains", "v2.0.0-RC3-6")
|
2019-04-25 17:16:49 +02:00
|
|
|
.!!
|
|
|
|
|
.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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2019-07-02 14:01:08 +02:00
|
|
|
lazy val lmCoursierFilters = {
|
|
|
|
|
mimaBinaryIssueFilters ++= {
|
|
|
|
|
import com.typesafe.tools.mima.core._
|
|
|
|
|
|
|
|
|
|
Seq(
|
2020-02-04 13:00:06 +01:00
|
|
|
// spurious errors on CI
|
|
|
|
|
ProblemFilters.exclude[IncompatibleSignatureProblem]("*"),
|
2019-08-15 17:33:52 +02:00
|
|
|
// Methods that shouldn't have been there
|
|
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.FileCredentials.get"),
|
|
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.DirectCredentials.matches"),
|
|
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.DirectCredentials.get"),
|
|
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.DirectCredentials.autoMatches"),
|
|
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.Credentials.get"),
|
2019-07-02 14:01:08 +02:00
|
|
|
// Removed unused method, shouldn't have been there in the first place
|
2019-07-08 17:31:25 +02:00
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem]("lmcoursier.credentials.DirectCredentials.authentication"),
|
|
|
|
|
// ignore shaded and internal stuff related errors
|
|
|
|
|
(pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.internal."))
|
2019-07-02 14:01:08 +02:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lazy val lmCoursierShadedFilters = {
|
|
|
|
|
mimaBinaryIssueFilters ++= {
|
|
|
|
|
import com.typesafe.tools.mima.core._
|
|
|
|
|
|
|
|
|
|
Seq(
|
2020-02-04 13:00:06 +01:00
|
|
|
// spurious errors on CI
|
|
|
|
|
ProblemFilters.exclude[IncompatibleSignatureProblem]("*"),
|
2019-07-02 14:01:08 +02:00
|
|
|
// Should have been put under lmcoursier.internal?
|
2019-07-08 17:31:25 +02:00
|
|
|
(pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.definitions.ToCoursier."))
|
2019-07-02 14:01:08 +02:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-25 17:16:49 +02:00
|
|
|
}
|