aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorJakob Odersky <jakob@driver.xyz>2018-10-11 12:28:03 -0700
committerJakob Odersky <jakob@odersky.com>2018-10-12 10:51:59 -0700
commit03ed05c0fcb948237d66f032c4e530b2349404b9 (patch)
treebe17a8a58fd66cb33fa93c2bc19a9c45f2a52698 /project
parent0a32398637816773406a08d2a201ef3be5836cb2 (diff)
downloaddriver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.tar.gz
driver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.tar.bz2
driver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.zip
Enable the Migration Manager Plugin to check for ABI changes
Diffstat (limited to 'project')
-rw-r--r--project/MiMaSettings.scala28
-rw-r--r--project/plugins.sbt3
2 files changed, 30 insertions, 1 deletions
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")