Skip to content

Commit

Permalink
Add sbt-version-policy (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz-bielski authored May 24, 2024
1 parent f36a4d4 commit 1da5c3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -40,4 +40,4 @@ jobs:
with:
type: ${{ job.status }}
job_name: Build
url: ${{ secrets.SLACK_WEBHOOK }}
url: ${{ secrets.SLACK_WEBHOOK }}
18 changes: 1 addition & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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](
Expand All @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 1da5c3f

Please sign in to comment.