pekko/project/MiMa.scala
Konrad `ktoso` Malawski 0f676cb6f1
use travis for mima and whitesource, remain no jenkins for tests (in parallel) (#24968)
* travis config from akka-http

* amend CONTRIBUTING to explain our tests

* amend wording in CONTRIBUTING

* new whitesource key

* remove instead of comment deployment things

* Update CONTRIBUTING.md

* exclude new module in 2.5 from appearing in 2.4 previous mima artifacts

* fix mima on 2.12
2018-04-24 22:58:54 +09:00

73 lines
2.3 KiB
Scala

/**
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package akka
import sbt._
import sbt.Keys._
import com.typesafe.tools.mima.plugin.MimaPlugin
import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._
object MiMa extends AutoPlugin {
private val latestPatchOf25 = 12
private val latestPatchOf24 = 20
override def requires = MimaPlugin
override def trigger = allRequirements
override val projectSettings = Seq(
mimaPreviousArtifacts := akkaPreviousArtifacts(name.value, organization.value, scalaBinaryVersion.value))
def akkaPreviousArtifacts(projectName: String, organization: String, scalaBinaryVersion: String): Set[sbt.ModuleID] = {
val versions: Seq[String] = {
val akka24NoStreamVersions = Seq("2.4.0", "2.4.1")
val akka25Versions = (0 to latestPatchOf25).map(patch s"2.5.$patch")
val akka24StreamVersions = (2 to 12) map ("2.4." + _)
val akka24WithScala212 =
(13 to latestPatchOf24)
.map("2.4." + _)
.filterNot(_ == "2.4.15") // 2.4.15 was released from the wrong branch and never announced
val akka242NewArtifacts = Seq(
"akka-stream",
"akka-stream-testkit")
val akka250NewArtifacts = Seq(
"akka-persistence-query")
scalaBinaryVersion match {
case "2.11"
if (akka250NewArtifacts.contains(projectName)) akka25Versions
else {
if (!akka242NewArtifacts.contains(projectName)) akka24NoStreamVersions
else Seq.empty
} ++ akka24StreamVersions ++ akka24WithScala212 ++ akka25Versions
case "2.12"
if (akka250NewArtifacts.contains(projectName))
akka25Versions
else
akka24WithScala212 ++ akka25Versions
case v if v.startsWith("2.13") =>
// no Akka released for 2.13 yet, no jars to check BC against
Seq.empty
}
}
val akka25PromotedArtifacts = Set(
"akka-distributed-data")
// check against all binary compatible artifacts
versions.map { v
val adjustedProjectName =
if (akka25PromotedArtifacts(projectName) && v.startsWith("2.4"))
projectName + "-experimental"
else
projectName
organization %% adjustedProjectName % v
}.toSet
}
}