-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sbt
More file actions
55 lines (46 loc) · 1.67 KB
/
build.sbt
File metadata and controls
55 lines (46 loc) · 1.67 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
import Dependencies._
name := "resource-pool"
organization := "com.evolution"
organizationName := "Evolution"
organizationHomepage := Some(url("https://evolution.com"))
homepage := Some(url("https://github.com/evolution-gaming/resource-pool"))
startYear := Some(2023)
crossScalaVersions := Seq("2.13.18", "3.3.7")
scalaVersion := crossScalaVersions.value.head
scalacOptions := crossSettings(
scalaVersion = scalaVersion.value,
if2 = Seq(
"-Xsource:3",
),
// 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.
//
// 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",
),
)
autoAPIMappings := true
versionScheme := Some("early-semver")
publishTo := Some(Resolver.evolutionReleases) // sbt-artifactory-plugin
versionPolicyIntention := Compatibility.BinaryCompatible // sbt-version-policy
libraryDependencies ++= Seq(
CatsEffect,
ScalaTest,
)
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT")))
def crossSettings[T](scalaVersion: String, if3: T, if2: T): T = {
scalaVersion match {
case version if version.startsWith("3") => if3
case _ => if2
}
}
addCommandAlias("fmt", "all scalafmtAll scalafmtSbt")
addCommandAlias("check", "all versionPolicyCheck scalafmtCheckAll scalafmtSbtCheck")
addCommandAlias("build", "all compile test")