forked from evolution-gaming/pubsub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
79 lines (62 loc) · 1.92 KB
/
Copy pathbuild.sbt
File metadata and controls
79 lines (62 loc) · 1.92 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
import Dependencies._
name := "pubsub"
organization := "com.evolutiongaming"
homepage := Some(url("https://github.com/evolution-gaming/pubsub"))
startYear := Some(2017)
organizationName := "Evolution"
organizationHomepage := Some(url("https://evolution.com"))
crossScalaVersions := Seq("2.13.18", "3.3.8")
scalaVersion := crossScalaVersions.value.head
publishTo := Some(Resolver.evolutionReleases)
libraryDependencies ++= Seq(
Akka.Actor,
Akka.Stream,
Akka.ClusterTools,
Akka.Testkit % Test,
Scodec.Bits,
Cats.core,
Cats.effect,
`metric-tools`,
`akka-serialization`,
`cats-helper`,
scache,
scalatest % Test,
)
libraryDependencies ++= crossSettings(
scalaVersion = scalaVersion.value,
if2 = Seq(Scodec.Scala2.Core),
if3 = Seq(Scodec.Scala3.Core),
)
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT")))
scalacOptions ++= Seq(
"-release:17",
"-deprecation",
)
scalacOptions ++= crossSettings(
scalaVersion = scalaVersion.value,
// Good compiler options for Scala 2.13 are coming from com.evolution:sbt-scalac-opts-plugin:0.0.9,
// but its support for Scala 3 is limited, especially what concerns linting options.
if2 = Seq(
"-Xsource:3",
),
// If Scala 3 is made the primary target, good linting scalac options for it should be added first.
if3 = Seq(
"-Ykind-projector:underscores",
// disable new brace-less syntax:
// https://alexn.org/blog/2022/10/24/scala-3-optional-braces/
"-no-indent",
// improve error messages:
"-explain",
"-explain-types",
),
)
Compile / doc / scalacOptions ++= Seq("-groups", "-implicits", "-no-link-warnings")
//addCommandAlias("check", "all versionPolicyCheck Compile/doc")
addCommandAlias("check", "show version")
addCommandAlias("build", "+all compile test")
def crossSettings[T](scalaVersion: String, if3: T, if2: T): T = {
scalaVersion match {
case version if version.startsWith("3") => if3
case _ => if2
}
}