-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
125 lines (113 loc) · 4.42 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val scalaVersion213 = "2.13.3"
lazy val root =
project
.in(file("."))
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.promqlClient,
library.timeseries,
library.sttpZioClient,
library.typesafeConfig,
library.zio % Provided,
library.zioTest % Test,
library.zioTestJunit % Test,
library.zioTestSbt % Test
),
publishArtifact := true,
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
scalaVersion := scalaVersion213,
crossScalaVersions := Seq("2.12.14", scalaVersion213)
)
lazy val examples =
project
.in(file("examples"))
.settings(settings)
.settings(
name := "examples",
libraryDependencies ++= Seq(
library.testContainers % Test,
library.zio % Provided,
library.zioTest % Test,
library.zioTestJunit % Test,
library.zioTestSbt % Test
),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
Test / fork := true,
scalaVersion := scalaVersion213,
crossScalaVersions := Seq("2.12.14", scalaVersion213)
)
.dependsOn(root)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
val zio = "1.0.12"
val sttp = "2.2.8"
val typesafeConfig = "1.4.0"
val promqlClient = "0.5.0"
val timeseries = "1.7.0"
val testContainersScala = "0.38.8"
}
val promqlClient = "io.sqooba.oss" %% "scala-promql-client" % Version.promqlClient
val timeseries = "io.sqooba.oss" %% "scala-timeseries-lib" % Version.timeseries
val zio = "dev.zio" %% "zio" % Version.zio
val zioTest = "dev.zio" %% "zio-test" % Version.zio
val zioTestSbt = "dev.zio" %% "zio-test-sbt" % Version.zio
val zioTestJunit = "dev.zio" %% "zio-test-junit" % Version.zio
val sttpZioClient = "com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % Version.sttp
val typesafeConfig = "com.typesafe" % "config" % Version.typesafeConfig
val testContainers = "com.dimafeng" %% "testcontainers-scala-scalatest" % Version.testContainersScala
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
scalafmtSettings ++
commandAliases
lazy val commonSettings =
Seq(
name := "chronos-client",
organization := "io.sqooba.oss",
organizationName := "Sqooba",
homepage := Some(url("https://github.com/Sqooba/chronos-client/")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
scmInfo := Some(
ScmInfo(
url("https://github.com/Sqooba/chronos-client.git"),
"scm:git:git@github.com:Sqooba/chronos-client.git"
)
),
developers := List(
Developer("ex0ns", "Ex0ns", "", url("https://github.com/ex0ns")),
Developer("yannbolliger", "Yann Bolliger", "", url("https://github.com/yannbolliger"))
),
scalacOptions --= Seq(
"-Xlint:nullary-override"
)
)
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true
)
lazy val commandAliases =
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt") ++
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")