Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 07d9abab1b
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (33 sloc) 1.405 kB
package plugin
import sbt._
import sbt.Keys.{fullClasspath, streams, classDirectory, ivySbt, name}
/** Sbt plugin for using MiMa. */
object MimaPlugin extends Plugin {
import MimaKeys._
/** Just configures MiMa to compare previous/current classfiles.*/
def mimaReportSettings: Seq[Setting[_]] = Seq(
findBinaryIssues <<= (previousClassfiles, currentClassfiles,
fullClasspath in findBinaryIssues, streams, name
) map { (prevOption, curr, cp, s, name) =>
prevOption match {
case Some(prev) =>
SbtMima.runMima(prev, curr, cp, s)
case None => + ": previous-artifact not set, not analyzing binary compatibility")
reportBinaryIssues <<= (findBinaryIssues, failOnProblem, streams, name) map SbtMima.reportErrors
/** Setup mima with default settings, applicable for most projects. */
def mimaDefaultSettings: Seq[Setting[_]] = Seq(
failOnProblem := true,
previousArtifact := None,
currentClassfiles <<= classDirectory in Compile map identity,
previousClassfiles <<= (ivySbt, previousArtifact, streams) map { (i, optArt, s) =>
optArt map { art => SbtMima.getPreviousArtifact(art, i, s) }
fullClasspath in findBinaryIssues <<= fullClasspath in Compile
) ++ mimaReportSettings
Jump to Line
Something went wrong with that request. Please try again.