lightbend-labs/mima

Missing Mill support

Iltotore opened this issue · 2 comments

Currently, MiMa can only be used in SBT (as far as I know). I would like to also be able to use it in Mill. The usage should look like this:

import $ivy.`com.typesafe::mill-mima-plugin:version`

import mill._, scalalib._
import com.typesafe.tools.mima.plugin.mill.MimaModule

object main extends ScalaModule with MimaModule {

  def scalaVersion = "3.2.2" //Required by ScalaModule

  def previousArtifacts = Set( //An Agg could also be used instead
    ivy"my.group::artifact:old1",
    ivy"my.group::artifact:old2",
    ...
    ivy"my.group::artifact:oldN",
  )
}

In CLI:

mill main.mimaReportBinaryIssues

Unlike SBT, Mill "plugins" are simple libraries. The plugin entrypoint would be the MimaModule (extending ScalaModule) which should look like this:

trait MimaModule extends ScalaModule {

  def previousArtifacts: Target[Set[Dep]] = T.source { ??? }

  //...

  def  mimaReportBinaryIssues: Command[Unit] = T.command { ??? }
}

My bad. It seems that an external port already exists.

a PR adding the link to our readme would be welcome