-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
100 lines (91 loc) · 2.84 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
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
import sbt.librarymanagement.For3Use2_13
import Dependencies._
def crossSettings[T](scalaVersion: String, if3: Seq[T], if2: Seq[T]) = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((3, _)) => if3
case Some((2, 12 | 13)) => if2
case _ => Nil
}
}
def is3(scalaVersion: String): Boolean = scalaVersion.startsWith("3")
lazy val commonSettings = Seq(
organization := "com.evolutiongaming",
homepage := Some(url("https://github.com/evolution-gaming/smetrics")),
startYear := Some(2019),
organizationName := "Evolution",
organizationHomepage := Some(url("https://evolution.com")),
scalaVersion := crossScalaVersions.value.head,
crossScalaVersions := Seq("2.13.8", "3.3.0", "2.12.16"),
publishTo := Some(Resolver.evolutionReleases),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
releaseCrossBuild := true,
Compile / doc / scalacOptions += "-no-link-warnings")
val alias: Seq[sbt.Def.Setting[?]] =
// addCommandAlias("check", "all versionPolicyCheck Compile/doc") ++
addCommandAlias("check", "show version") ++
addCommandAlias("build", "+all compile test")
lazy val root = (project
in file(".")
settings commonSettings
settings (alias)
settings (
publish / skip := true,
name := "smetrics-parent"
)
aggregate(smetrics, prometheus, http4s, doobie))
lazy val smetrics = (project
in file("smetrics")
settings commonSettings
settings(
name := "smetrics",
scalacOptsFailOnWarn := Some(false),
libraryDependencies ++= Seq(
Cats.core,
Cats.effect,
`cats-helper`,
scalatest % Test),
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = Nil,
if2 = List(compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full))
),
scalacOptions ++= crossSettings(
scalaVersion.value,
if3 = Seq("-Ykind-projector:underscores", "-language:implicitConversions"),
if2 = Seq("-Xsource:3", "-P:kind-projector:underscore-placeholders")
)
))
lazy val prometheus = (project
in file("modules/prometheus")
settings commonSettings
dependsOn smetrics % "compile->compile;test->test"
settings (
name := "smetrics-prometheus",
libraryDependencies ++= Seq(
Dependencies.prometheus,
Dependencies.prometheusCommon,
scalatest % Test
)
)
)
lazy val http4s = (project
in file("modules/http4s")
settings commonSettings
dependsOn smetrics % "compile->compile;test->test"
settings(
name := "smetrics-http4s",
libraryDependencies += Dependencies.http4s
)
)
lazy val doobie = (project
in file("modules/doobie")
settings commonSettings
dependsOn smetrics % "compile->compile;test->test"
settings(
name := "smetrics-doobie",
libraryDependencies += Dependencies.doobie,
libraryDependencies ++= Seq(
Dependencies.doobie,
`cats-helper`)
)
)