From c1c3973d8f68a8c38270ccf4214b1df25ac939fd Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 22 Aug 2024 21:00:34 +0200 Subject: [PATCH] Fix mima checks, make sure to run them --- build.sbt | 21 ++++++++------------- crossrelease.sh | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/build.sbt b/build.sbt index 7ce49d6b..100624c7 100644 --- a/build.sbt +++ b/build.sbt @@ -51,7 +51,8 @@ lazy val root = project publish := {}, publishLocal := {}, name := "metrics4-scala-root", - sonatypeProfileName := "nl.grons" + sonatypeProfileName := "nl.grons", + mimaPreviousArtifacts := Set.empty, ) lazy val metricsScala = project @@ -65,7 +66,7 @@ lazy val metricsScala = project "io.dropwizard.metrics" % "metrics-core" % "4.2.27", "io.dropwizard.metrics" % "metrics-healthchecks" % "4.2.27" ), - mimaPreviousArtifacts := mimaPrevious(scalaVersion.value) + mimaPreviousArtifacts := mimaPrevious(name.value, scalaVersion.value) ) lazy val metricsScalaHdr = project @@ -81,7 +82,7 @@ lazy val metricsScalaHdr = project // Override version that hdrhistogram-metrics-reservoir depends on: "org.hdrhistogram" % "HdrHistogram" % "2.2.2" ), - mimaPreviousArtifacts := mimaPrevious(scalaVersion.value) + mimaPreviousArtifacts := mimaPrevious(name.value, scalaVersion.value) ) lazy val metricsPekko = project @@ -116,7 +117,7 @@ lazy val metricsAkka26 = project // scala-steward:on ), sourceDirectory := baseDirectory.value.getParentFile / "metrics-akka" / "src", - mimaPreviousArtifacts := mimaPrevious(scalaVersion.value) + mimaPreviousArtifacts := mimaPrevious(name.value, scalaVersion.value) ) lazy val metricsAkka25 = project @@ -135,20 +136,14 @@ lazy val metricsAkka25 = project // scala-steward:on ), sourceDirectory := baseDirectory.value.getParentFile / "metrics-akka" / "src", - mimaPreviousArtifacts := mimaPrevious(scalaVersion.value) + mimaPreviousArtifacts := mimaPrevious(name.value, scalaVersion.value) ) // 2.11.x are the only pre-2.12 scala versions that are used in this build def before212(scalaVersion: String): Boolean = scalaVersion.startsWith("2.11.") -def mimaPrevious(scalaVersion: String): Set[ModuleID] = { - if (scalaVersion.startsWith("3.")) - Set("nl.grons" %% "metrics4-scala" % "4.2.8") - else if (scalaVersion.startsWith("2.13.")) - Set("nl.grons" %% "metrics4-scala" % "4.0.7") - else - Set("nl.grons" %% "metrics4-scala" % "4.0.1") -} +def mimaPrevious(module: String, scalaVersion: String): Set[ModuleID] = + Set("nl.grons" %% module % "4.2.8") def scalacTargets(scalaVersion: String): Seq[String] = { if (scalaVersion.startsWith("2.11.") || scalaVersion.startsWith("2.12.")) Seq("-target:jvm-1.8") diff --git a/crossrelease.sh b/crossrelease.sh index 53f165fb..b0726071 100755 --- a/crossrelease.sh +++ b/crossrelease.sh @@ -1,7 +1,7 @@ #!/bin/bash # Does a full cross build of all scala/akka versions. -DEFAULT_COMMAND="+publishSigned; sonatypeBundleRelease" +DEFAULT_COMMAND="; +clean; +test; +package; +mimaFindBinaryIssues; +publishSigned; sonatypeBundleRelease" # Assumes osx export JAVA_HOME=`/usr/libexec/java_home -v 11`