|
| 1 | +import Dependencies.* |
| 2 | + |
| 3 | +lazy val scala3 = "3.2.2" |
| 4 | +lazy val scala213 = "2.13.10" |
| 5 | +lazy val supportedScalaVersions = List(scala3, scala213) |
| 6 | +lazy val scmUrl = "https://github.com/sky-uk/fs2-kafka-topic-loader" |
| 7 | + |
| 8 | +ThisBuild / organization := "uk.sky" |
| 9 | +ThisBuild / description := "Read the contents of provided Kafka topics" |
| 10 | +ThisBuild / licenses := List("BSD New" -> url("https://opensource.org/licenses/BSD-3-Clause")) |
| 11 | + |
| 12 | +ThisBuild / scalaVersion := scala213 // TODO - for development to get unused warnings |
| 13 | +ThisBuild / crossScalaVersions := supportedScalaVersions |
| 14 | +ThisBuild / semanticdbEnabled := true |
| 15 | +ThisBuild / semanticdbVersion := scalafixSemanticdb.revision |
| 16 | + |
| 17 | +ThisBuild / scalafixDependencies += Dependencies.Plugins.organizeImports |
| 18 | + |
| 19 | +tpolecatScalacOptions ++= Set(ScalacOptions.source3) |
| 20 | + |
| 21 | +lazy val root = (project in file(".")) |
| 22 | + .settings( |
| 23 | + name := "fs2-kafka-topic-loader", |
| 24 | + libraryDependencies ++= Seq(scalaTest) |
| 25 | + ) |
| 26 | + |
| 27 | +/** Scala 3 doesn't support two rules yet - RemoveUnused and ProcedureSyntax. So we require a different scalafix config |
| 28 | + * for Scala 3 |
| 29 | + * |
| 30 | + * RemoveUnused relies on -warn-unused which isn't available in scala 3 yet - |
| 31 | + * https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html |
| 32 | + * |
| 33 | + * ProcedureSyntax doesn't exist in Scala 3 - https://scalacenter.github.io/scalafix/docs/rules/ProcedureSyntax.html |
| 34 | + */ |
| 35 | +ThisBuild / scalafixConfig := { |
| 36 | + CrossVersion.partialVersion(scalaVersion.value) match { |
| 37 | + case Some((3, _)) => Some((ThisBuild / baseDirectory).value / ".scalafix3.conf") |
| 38 | + case _ => None |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +Test / parallelExecution := false |
| 43 | +Test / fork := true |
| 44 | + |
| 45 | +Global / onChangedBuildSource := ReloadOnSourceChanges |
0 commit comments