-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
67 lines (55 loc) · 2.4 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
lazy val scala3 = "3.3.1"
lazy val scala213 = "2.13.10"
lazy val supportedScalaVersions = List(scala3, scala213)
lazy val scmUrl = "https://github.com/sky-uk/kafka-topic-loader"
name := "kafka-topic-loader"
organization := "uk.sky"
description := "Reads the contents of provided Kafka topics"
sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
homepage := Some(url(scmUrl))
licenses := List("BSD New" -> url("https://opensource.org/licenses/BSD-3-Clause"))
developers := List(
Developer(
"Sky UK OSS",
"Sky UK OSS",
sys.env.getOrElse("SONATYPE_EMAIL", scmUrl),
url(scmUrl)
)
)
scalaVersion := scala3
crossScalaVersions := supportedScalaVersions
semanticdbEnabled := true
semanticdbVersion := scalafixSemanticdb.revision
tpolecatScalacOptions ++= Set(ScalacOptions.source3)
ThisBuild / scalacOptions ++= Seq("-explaintypes", "-Wconf:msg=annotation:silent")
ThisBuild / scalafixDependencies += Dependencies.Plugins.organizeImports
/** Scala 3 doesn't support two rules yet - RemoveUnused and ProcedureSyntax. So we require a different scalafix config
* for Scala 3
*
* RemoveUnused relies on -warn-unused which isn't available in scala 3 yet -
* https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html
*
* ProcedureSyntax doesn't exist in Scala 3 - https://scalacenter.github.io/scalafix/docs/rules/ProcedureSyntax.html
*/
scalafixConfig := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Some((ThisBuild / baseDirectory).value / ".scalafix3.conf")
case _ => None
}
}
Test / parallelExecution := false
Test / fork := true
Global / onChangedBuildSource := ReloadOnSourceChanges
libraryDependencies ++= Dependencies.all
excludeDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Dependencies.scala3Exclusions
case _ => Seq.empty
}
}
addCommandAlias("checkFix", "scalafixAll --check OrganizeImports; scalafixAll --check")
addCommandAlias("runFix", "scalafixAll OrganizeImports; scalafixAll")
addCommandAlias("checkFmt", "scalafmtCheckAll; scalafmtSbtCheck")
addCommandAlias("runFmt", "scalafmtAll; scalafmtSbt")
addCommandAlias("ciBuild", "checkFmt; checkFix; +test")