From 0e10245af700f61b39630ceb706eed49ac99f4c7 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Fri, 11 Jan 2019 14:39:42 +0100 Subject: [PATCH 1/2] Fix #1185 Add MiMa to check binary compatibility --- build.sbt | 24 +++++++++++++++++++++++- project/plugins.sbt | 3 +++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 28cb1afdd..f0cc4dbbb 100644 --- a/build.sbt +++ b/build.sbt @@ -58,6 +58,28 @@ git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git" // scripted test settings scriptedLaunchOpts += "-Dproject.version=" + version.value +// binary compatibility settings +mimaPreviousArtifacts := { + val m = organization.value %% moduleName.value % "1.3.15" + val sbtBinV = (sbtBinaryVersion in pluginCrossBuild).value + val scalaBinV = (scalaBinaryVersion in update).value + Set( + Defaults.sbtPluginExtra(m cross CrossVersion.Disabled(), sbtBinV, scalaBinV) + ) +} +mimaBinaryIssueFilters ++= { + import com.typesafe.tools.mima.core._ + List( + // added via #1179 + ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmKeys.rpmEpoch"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmKeys.com$typesafe$sbt$packager$rpm$RpmKeys$_setter_$rpmEpoch_="), + ProblemFilters.exclude[MissingTypesProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.apply"), + ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.copy"), + ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.this") + ) +} + // Release configuration publishMavenStyle := false @@ -84,7 +106,7 @@ bintrayRepository := "sbt-plugin-releases" addCommandAlias("scalafmtAll", "; scalafmt ; test:scalafmt ; sbt:scalafmt") // ci commands addCommandAlias("validateFormatting", "; scalafmt::test ; test:scalafmt::test ; sbt:scalafmt::test") -addCommandAlias("validate", "; clean ; update ; validateFormatting ; test") +addCommandAlias("validate", "; clean ; update ; validateFormatting ; test ; mimaReportBinaryIssues") // List all scripted test separately to schedule them in different travis-ci jobs. // Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted diff --git a/project/plugins.sbt b/project/plugins.sbt index cbdeca66c..f6368e65b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -14,3 +14,6 @@ addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") // For code formatting addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") + +// binary compatibility checks +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0") \ No newline at end of file From a61acfb980933c397cace8bc33edcbacab773651 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Fri, 11 Jan 2019 14:59:23 +0100 Subject: [PATCH 2/2] scalafmt --- build.sbt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index f0cc4dbbb..e2b86845a 100644 --- a/build.sbt +++ b/build.sbt @@ -63,16 +63,16 @@ mimaPreviousArtifacts := { val m = organization.value %% moduleName.value % "1.3.15" val sbtBinV = (sbtBinaryVersion in pluginCrossBuild).value val scalaBinV = (scalaBinaryVersion in update).value - Set( - Defaults.sbtPluginExtra(m cross CrossVersion.Disabled(), sbtBinV, scalaBinV) - ) + Set(Defaults.sbtPluginExtra(m cross CrossVersion.Disabled(), sbtBinV, scalaBinV)) } mimaBinaryIssueFilters ++= { import com.typesafe.tools.mima.core._ List( // added via #1179 ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmKeys.rpmEpoch"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmKeys.com$typesafe$sbt$packager$rpm$RpmKeys$_setter_$rpmEpoch_="), + ProblemFilters.exclude[ReversedMissingMethodProblem]( + "com.typesafe.sbt.packager.rpm.RpmKeys.com$typesafe$sbt$packager$rpm$RpmKeys$_setter_$rpmEpoch_=" + ), ProblemFilters.exclude[MissingTypesProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata$"), ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.apply"), ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.rpm.RpmMetadata.copy"),