Skip to content

Commit c4ef5aa

Browse files
authored
Fix #1185 Add MiMa to check binary compatibility (#1188)
* Fix #1185 Add MiMa to check binary compatibility * scalafmt
1 parent 78ff7be commit c4ef5aa

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

build.sbt

+23-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ git.remoteRepo := "[email protected]:sbt/sbt-native-packager.git"
5858
// scripted test settings
5959
scriptedLaunchOpts += "-Dproject.version=" + version.value
6060

61+
// binary compatibility settings
62+
mimaPreviousArtifacts := {
63+
val m = organization.value %% moduleName.value % "1.3.15"
64+
val sbtBinV = (sbtBinaryVersion in pluginCrossBuild).value
65+
val scalaBinV = (scalaBinaryVersion in update).value
66+
Set(Defaults.sbtPluginExtra(m cross CrossVersion.Disabled(), sbtBinV, scalaBinV))
67+
}
68+
mimaBinaryIssueFilters ++= {
69+
import com.typesafe.tools.mima.core._
70+
List(
71+
// added via #1179
72+
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmKeys.rpmEpoch"),
73+
ProblemFilters.exclude[ReversedMissingMethodProblem](
74+
"com.typesafe.sbt.packager.rpm.RpmKeys.com$typesafe$sbt$packager$rpm$RpmKeys$_setter_$rpmEpoch_="
75+
),
76+
ProblemFilters.exclude[MissingTypesProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata$"),
77+
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.apply"),
78+
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.copy"),
79+
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.this")
80+
)
81+
}
82+
6183
// Release configuration
6284
publishMavenStyle := false
6385

@@ -84,7 +106,7 @@ bintrayRepository := "sbt-plugin-releases"
84106
addCommandAlias("scalafmtAll", "; scalafmt ; test:scalafmt ; sbt:scalafmt")
85107
// ci commands
86108
addCommandAlias("validateFormatting", "; scalafmt::test ; test:scalafmt::test ; sbt:scalafmt::test")
87-
addCommandAlias("validate", "; clean ; update ; validateFormatting ; test")
109+
addCommandAlias("validate", "; clean ; update ; validateFormatting ; test ; mimaReportBinaryIssues")
88110

89111
// List all scripted test separately to schedule them in different travis-ci jobs.
90112
// Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted

project/plugins.sbt

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
1414

1515
// For code formatting
1616
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15")
17+
18+
// binary compatibility checks
19+
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0")

0 commit comments

Comments
 (0)