From 1da5c3fd7435823d0756d93c0e3acd6ee3c24d46 Mon Sep 17 00:00:00 2001 From: Grzegorz Bielski Date: Fri, 24 May 2024 09:39:59 +0200 Subject: [PATCH] Add sbt-version-policy (#423) --- .github/workflows/ci.yml | 4 ++-- build.sbt | 18 +----------------- project/plugins.sbt | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddf290bd..84c04345 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: java-version: 17 - name: build ${{ matrix.scala }} - run: sbt ++${{ matrix.scala }} clean coverage test mimaReportBinaryIssues + run: sbt ++${{ matrix.scala }} clean coverage test versionPolicyCheck - name: test coverage if: success() @@ -40,4 +40,4 @@ jobs: with: type: ${{ job.status }} job_name: Build - url: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file + url: ${{ secrets.SLACK_WEBHOOK }} diff --git a/build.sbt b/build.sbt index 62581711..70b26b14 100644 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,8 @@ import Dependencies._ import com.typesafe.tools.mima.core._ ThisBuild / versionScheme := Some("early-semver") - ThisBuild / evictionErrorLevel := Level.Warn +ThisBuild / versionPolicyIntention := Compatibility.BinaryCompatible def crossSettings[T](scalaVersion: String, if3: List[T], if2: List[T]) = CrossVersion.partialVersion(scalaVersion) match { @@ -35,19 +35,6 @@ lazy val commonSettings = Seq( ), scalacOptsFailOnWarn := Some(false), publishTo := Some(Resolver.evolutionReleases), - // KeyRanks.Invisible to suppress sbt warning about key not being used in root/tests where MiMa plugin is disabled - mimaPreviousArtifacts.withRank(KeyRanks.Invisible) := { - val versions = List( - "11.0.0", - ) - - // check against all versions once Scala 3 lib version is published - crossSettings( - scalaVersion.value, - if3 = Nil, - if2 = versions.map(organization.value %% moduleName.value % _) - ).toSet - }, mimaBinaryIssueFilters ++= Seq( ProblemFilters.exclude[ReversedMissingMethodProblem]("com.evolutiongaming.skafka.consumer.Consumer.subscribe"), ProblemFilters.exclude[DirectMissingMethodProblem]( @@ -64,7 +51,6 @@ lazy val root = (project in file(".") aggregate (skafka, `play-json`, metrics, tests)) lazy val skafka = (project in file("skafka") - disablePlugins (MimaPlugin) settings commonSettings settings (name := "skafka", scalacOptions -= "-Ywarn-unused:params", @@ -92,13 +78,11 @@ lazy val `play-json` = (project in file("modules/play-json") lazy val metrics = (project in file("modules/metrics") settings (name := "skafka-metrics") - disablePlugins (MimaPlugin) settings commonSettings dependsOn skafka settings (libraryDependencies ++= Seq(Smetrics.`smetrics-prometheus`))) lazy val tests = (project in file("tests") - disablePlugins (MimaPlugin) settings (name := "skafka-tests") settings commonSettings settings Seq(publish / skip := true, Test / fork := true, Test / parallelExecution := false) diff --git a/project/plugins.sbt b/project/plugins.sbt index c4f79e44..81fabaa3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9") addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") +addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.1")