-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbuild.sbt
More file actions
101 lines (95 loc) · 3.02 KB
/
Copy pathbuild.sbt
File metadata and controls
101 lines (95 loc) · 3.02 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import Dependencies.*
def crossSettings[T](scalaVersion: String, if3: T, if2: T): T = {
scalaVersion match {
case version if version.startsWith("3") => if3
case _ => if2
}
}
lazy val commonSettings = Seq(
organization := "com.evolution",
homepage := Some(uri("https://github.com/evolution-gaming/scache")),
startYear := Some(2019),
organizationName := "Evolution",
organizationHomepage := Some(uri("https://evolution.com")),
scalaVersion := crossScalaVersions.value.head,
crossScalaVersions := Seq("2.13.18", "3.3.8"),
scalacOptsFailOnWarn := crossSettings(
scalaVersion.value,
if3 = Some(false),
if2 = Some(true),
),
scalacOptions ++= crossSettings(
scalaVersion.value,
if3 = Seq(
"-Ykind-projector:underscores",
"-language:implicitConversions",
"-source:future",
// improve error messages:
"-explain",
"-explain-types",
),
if2 = Seq(
"-Xsource:3",
"-P:kind-projector:underscore-placeholders",
),
),
// Under sbt 2 the compile cache can skip re-creating scoverage's data directory after `clean`.
// When a module's instrumented code runs inside another module's forked test JVM (before that
// module's own tests, if any, have run), scoverage.Invoker then crashes writing measurements to
// the missing directory. Ensure it always exists after compile whenever coverage is enabled.
Compile / compile := Def.uncached {
val compiled = (Compile / compile).value
if (coverageEnabled.value) {
val _ = (crossTarget.value / "scoverage-data").mkdirs()
}
compiled
},
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = Nil,
if2 = Seq(
compilerPlugin(betterMonadicFor),
compilerPlugin(`kind-projector`.cross(CrossVersion.full)),
),
),
autoAPIMappings := true,
licenses := Seq(("MIT", uri("https://opensource.org/licenses/MIT"))),
Test / publishArtifact := false,
publishTo := Some(Resolver.evolutionReleases),
versionPolicyIntention := Compatibility.BinaryCompatible,
versionPolicyIgnored ++= Seq(
// add libraries here that are known to be binary compatible, like:
// "com.evolutiongaming" %% "smetrics",
),
)
lazy val root = (project in file("."))
.settings(commonSettings)
.settings(
name := "scache-root",
publish / skip := true,
publishArtifact := false,
)
.aggregate(`cache-adt`, scache)
lazy val `cache-adt` = (project in file("cache-adt"))
.settings(commonSettings)
.settings(
name := "cache-adt",
description := "Directive ADT for scache",
)
lazy val scache = (project in file("scache"))
.settings(commonSettings)
.settings(
name := "scache",
description := "Cache in Scala with cats-effect",
libraryDependencies ++= Seq(
Cats.core,
Cats.effect,
`cats-helper`,
smetrics,
scalatest % Test,
),
)
.dependsOn(`cache-adt`)
addCommandAlias("fmt", "+scalafmtRepo")
addCommandAlias("check", "+all versionPolicyCheck Compile/doc scalafmtCheckRepo")
addCommandAlias("build", "all test package")