diff options
author | Jakob Odersky <jakob@driver.xyz> | 2018-10-11 12:28:03 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-10-12 10:51:59 -0700 |
commit | 03ed05c0fcb948237d66f032c4e530b2349404b9 (patch) | |
tree | be17a8a58fd66cb33fa93c2bc19a9c45f2a52698 | |
parent | 0a32398637816773406a08d2a201ef3be5836cb2 (diff) | |
download | driver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.tar.gz driver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.tar.bz2 driver-core-03ed05c0fcb948237d66f032c4e530b2349404b9.zip |
Enable the Migration Manager Plugin to check for ABI changes
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | build.sbt | 1 | ||||
-rw-r--r-- | project/MiMaSettings.scala | 28 | ||||
-rw-r--r-- | project/plugins.sbt | 3 |
4 files changed, 32 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index 7845eae..5ab8328 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,5 @@ scala: script: - echo 'credentials += Credentials("Artifactory Realm", "drivergrp.jfrog.io", "sbt-publisher", sys.env("ARTIFACTORY_PASSWORD"))' > project/credentials.sbt - - sbt clean +test + - sbt clean compile checkAbi +test - if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_TAG" =~ ^v[0-9].* ]]; then sbt publish; fi @@ -10,6 +10,7 @@ scalacOptions in ThisBuild in (Compile, doc) ++= Seq( "-doc-source-url", s"https://github.com/drivergroup/driver-core/blob/master€{FILE_PATH}.scala" ) +abiVersion in ThisBuild := "2.0.0-M3" val mockito = "org.mockito" % "mockito-core" % "1.9.5" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" 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") |