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 != '.') &&
|
2024-10-09 10:48:43 +02:00
|
|
|
ver
|
|
|
|
|
.replace("-RC", "-")
|
|
|
|
|
.forall(c => c == '.' || c == '-' || c.isDigit)
|
2019-04-25 17:16:49 +02:00
|
|
|
|
|
|
|
|
def binaryCompatibilityVersions: Set[String] =
|
2024-10-09 10:48:43 +02:00
|
|
|
Seq("git", "tag", "--merged", "HEAD^", "--contains", "v2.0.0-RC3-6").!!.linesIterator
|
2019-04-25 17:16:49 +02:00
|
|
|
.map(_.trim)
|
|
|
|
|
.filter(_.startsWith("v"))
|
|
|
|
|
.map(_.stripPrefix("v"))
|
|
|
|
|
.filter(stable)
|
|
|
|
|
.toSet
|
|
|
|
|
|
|
|
|
|
def settings: Seq[Setting[_]] = Seq(
|
2024-06-09 21:09:25 +02:00
|
|
|
MimaPlugin.autoImport.mimaPreviousArtifacts := Set.empty,
|
|
|
|
|
// MimaPlugin.autoImport.mimaPreviousArtifacts := {
|
|
|
|
|
// binaryCompatibilityVersions.map { ver =>
|
|
|
|
|
// (organization.value % moduleName.value % ver).cross(crossVersion.value)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2019-04-25 17:16:49 +02:00
|
|
|
)
|
|
|
|
|
|
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
|
2024-10-09 10:48:43 +02:00
|
|
|
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
|
2024-10-09 10:48:43 +02:00
|
|
|
ProblemFilters.exclude[DirectMissingMethodProblem](
|
|
|
|
|
"lmcoursier.credentials.DirectCredentials.authentication"
|
|
|
|
|
),
|
2019-07-08 17:31:25 +02:00
|
|
|
// 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?
|
2020-03-31 02:16:21 +02:00
|
|
|
(pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.definitions.ToCoursier.")),
|
|
|
|
|
(pb: Problem) => pb.matchName.forall(!_.startsWith("lmcoursier.definitions.FromCoursier."))
|
2019-07-02 14:01:08 +02:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-25 17:16:49 +02:00
|
|
|
}
|