From 03ed05c0fcb948237d66f032c4e530b2349404b9 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 11 Oct 2018 12:28:03 -0700 Subject: Enable the Migration Manager Plugin to check for ABI changes --- project/MiMaSettings.scala | 28 ++++++++++++++++++++++++++++ project/plugins.sbt | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 project/MiMaSettings.scala (limited to 'project') diff --git a/project/MiMaSettings.scala b/project/MiMaSettings.scala new file mode 100644 index 0000000..d3ec3c1 --- /dev/null +++ b/project/MiMaSettings.scala @@ -0,0 +1,28 @@ +import com.typesafe.tools.mima.plugin.MimaPlugin +import sbt.{Def, _} +import sbt.Keys._ + +/** This plugin extends the Migration Manager (MiMa) Plugin with common settings + * for driver-core projects. + */ +object MiMaSettings extends AutoPlugin { + + override def requires = MimaPlugin + override def trigger = allRequirements + + object autoImport { + val abiVersion = settingKey[String]("Previous version of binary-compatible projects") + val checkAbi = taskKey[Unit]("Check ABI compatibility with declared abiVersion") + } + import autoImport._ + import MimaPlugin.autoImport._ + + override def buildSettings: Seq[Def.Setting[_]] = Seq(abiVersion := "") + override def projectSettings: Seq[Def.Setting[_]] = Seq( + mimaPreviousArtifacts := Set( + "xyz.driver" %% name.value % abiVersion.value + ), + checkAbi := mimaReportBinaryIssues.value + ) + +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 736226d..f0e3a6d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,2 @@ -addSbtPlugin("xyz.driver" % "sbt-settings" % "2.0.9") +addSbtPlugin("xyz.driver" % "sbt-settings" % "2.0.9") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0") -- cgit v1.2.3