Today, Typesafe is open sourcing the code behind Migration Manager, a binary compatibility reporting tool for Scala.
Migration Manager gives Scala project owners the ability to test their projects for binary compatibility with prior versions. Migration Manager has already been used to ensure binary compatibility for the 2.9.x series of Scala releases, and we look forward to seeing other projects in the Scala ecosystem adopt it soon.
While Migration Manager has been available for download free of charge since its inception, Typesafe has now made the source code available under the Apache License 2.0 in this GitHub repository. Please check it out and contribute!
Migration Manager provides the ability to detect binary incompatible changes between two versions of the same project. This can be done in one of three ways:
Rich User Interface
The rich user interface is the same interface that has been available for the life of the tool. You can find a more detailed getting started guide at Migration Manager - Step by Step guide.
Command Line
With the open-source release of the Migration Manager, a command line interface has been added. You can download the standalone jar here.
Here’s how to invoke it:
java -jar path/to/mima-reporter-assembly-0.1.3.jar \ --prev previous.jar \ --curr current.jar Found 0 binary incompatibiities ===============================
SBT Plugin
The Migration Manager also provides an SBT plugin for usage within SBT.
To use it, add the following lines to your project/plugins.sbt
file:
resolvers += Resolver.url("sbt-plugin-releases", new URL( "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns) addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.3")
And then in your build.sbt
, configure the migration manager so that it knows which artifact to use for testing binary compatibility:
import com.typesafe.tools.mima.plugin.MimaPlugin.{ mimaDefaultSettings, previousArtifact } mimaDefaultSettings previousArtifact := Some("organization" % "artifact" % "1.0")
In the above, the previousArtifact
setting is used to resolve the previous version of your project, using the resolvers defined in your project, and compare the current class files to the previous version. To run the test, call the mima-report-binary-issues
task from the SBT prompt.
Summary
We’re excited to make this open source contribution, and we look forward to collaborating with the Scala community to continue to improve Migration Manager.
For downloads and to learn more, please visit the Migration Manager page on the Typesafe web site.